Skip to content

Commit 1441784

Browse files
committed
fix: capture stacktrace from createError
1 parent b376b4e commit 1441784

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/error.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export function createError (input: Partial<H3Error>): H3Error {
2828
if (input instanceof H3Error) {
2929
return input
3030
}
31+
3132
const err = new H3Error(input.message)
33+
Error.captureStackTrace(err, createError)
34+
3235
if (input.statusCode) {
3336
err.statusCode = input.statusCode
3437
}

0 commit comments

Comments
 (0)