|
@@ -12,9 +12,10 @@ export = () => {
|
|
};
|
|
};
|
|
return loggerMiddleware(ctx, next)
|
|
return loggerMiddleware(ctx, next)
|
|
.catch(error => {
|
|
.catch(error => {
|
|
- const { body, status, message } = error;
|
|
|
|
|
|
+ const { body, status = 500, message } = error;
|
|
const errorText = `res: ${JSON.stringify({ status, message, body })}`;
|
|
const errorText = `res: ${JSON.stringify({ status, message, body })}`;
|
|
ctx.$log.error(errorText);
|
|
ctx.$log.error(errorText);
|
|
|
|
+ ctx.status = status
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|