Skip to content

Commit

Permalink
feat: handle error cause (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jun 10, 2022
1 parent 8eb9969 commit 3c3b6bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createError (input: string | Partial<H3Error>): H3Error {
return input
}

const err = new H3Error(input.message ?? input.statusMessage)
const err = new H3Error(input.message ?? input.statusMessage, input.cause ? { cause: input.cause } : undefined)

if (input.statusCode) {
err.statusCode = input.statusCode
Expand Down

0 comments on commit 3c3b6bd

Please sign in to comment.