learn-request-queue/src/errors.ts

12 lines
316 B
TypeScript

import express from "express";
function errorHandler(request: express.Request, response: express.Response, e: any) {
response.status(500);
response.send("Internal server error");
console.log("Exception hit!");
console.log(`Request path: ${request.route.path}`);
console.log(e.stack);
}
export = errorHandler;