log error path

This commit is contained in:
DIYgod
2018-11-19 11:14:23 +08:00
parent 729e5b1643
commit 39973d60ea
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = async (ctx, next) => {
try {
await next();
} catch (err) {
logger.error('Promise error: ' + (err instanceof Error ? err.stack : err));
logger.error(`Error in ${ctx.request.path}: ${err instanceof Error ? err.stack : err}`);
ctx.set({
'Content-Type': 'text/html; charset=UTF-8',
});