mysteriously fixes error handler by adding next argument

This commit is contained in:
James
2020-07-28 14:12:57 -04:00
parent 470a33f7f9
commit aefdabfd7e

View File

@@ -2,7 +2,7 @@ const httpStatus = require('http-status');
const formatErrorResponse = require('../responses/formatError');
const logger = require('../../utilities/logger')();
const errorHandler = (config) => async (err, req, res) => {
const errorHandler = (config) => async (err, req, res, next) => {
const data = formatErrorResponse(err);
let response;
let status = err.status || httpStatus.INTERNAL_SERVER_ERROR;