error factory in express in typescript

index.ts
import { Request, Response, NextFunction } from 'express';

export const errorHandler = (err: Error, req: Request, res: Response, next: NextFunction) => {
    console.error(err);
    res.status(500).json({
        message: 'Internal Server Error'
    });
};
258 chars
9 lines

related categories

gistlibby LogSnag