mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Re-fix errorMiddleware (#3922)
This commit is contained in:
parent
c972e1ee1f
commit
e5563843a2
@ -246,7 +246,7 @@ const startWorker = (workerId) => {
|
||||
accountFromRequest(req, next);
|
||||
};
|
||||
|
||||
const errorMiddleware = (err, req, res, next) => { // eslint-disable-line no-unused-vars
|
||||
const errorMiddleware = (err, req, res, {}) => {
|
||||
log.error(req.requestId, err.toString());
|
||||
res.writeHead(err.statusCode || 500, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ error: err.statusCode ? err.toString() : 'An unexpected error occurred' }));
|
||||
|
Loading…
Reference in New Issue
Block a user