Skip to content

Commit

Permalink
fix: hide 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 12, 2020
1 parent 42c3da4 commit 38fb027
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function createHandle (stack: Stack): PHandle {
}
}
if (!res.writableEnded) {
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
return sendError(res, createError({ statusCode: 404, statusMessage: 'Not Found' }), false)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function createError (input: Partial<H2Error>): H2Error {
return err
}

export function sendError (res: ServerResponse, error: Error | H2Error, debug: boolean) {
export function sendError (res: ServerResponse, error: Error | H2Error, debug?: boolean) {
const h2Error = createError(error)

// @ts-ignore
Expand Down

0 comments on commit 38fb027

Please sign in to comment.