app: wrap error message in <pre>

This commit is contained in:
DIYgod 2018-06-02 19:42:02 +08:00
parent 274cd56a4d
commit 46feb2a1ce
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ module.exports = async (ctx, next) => {
ctx.set({
'Content-Type': 'text/html; charset=UTF-8',
});
ctx.body = 'RSSHub 发生了一些意外: ' + err;
ctx.body = `RSSHub 发生了一些意外: <pre>${err instanceof Error ? err.stack : err}</pre>`;
ctx.status = 500;
}
};