learn-request-queue/src/errors.ts

12 lines
316 B
TypeScript
Raw Normal View History

2020-07-02 20:06:13 +00:00
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;