0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00

feat: show stack-trace in default error handler (#158)

This commit is contained in:
Yusuke Wada 2022-04-20 17:16:36 +09:00 committed by GitHub
parent a95ffe0be1
commit 3e5171fe15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ export class Hono {
} }
private errorHandler: ErrorHandler = (err: Error, c: Context) => { private errorHandler: ErrorHandler = (err: Error, c: Context) => {
console.error(`${err.message}`) console.error(`${err.stack || err.message}`)
const message = 'Internal Server Error' const message = 'Internal Server Error'
return c.text(message, 500) return c.text(message, 500)
} }