Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve setErrorHandler example #4484

Merged
merged 4 commits into from Jan 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/Reference/Errors.md
Expand Up @@ -112,7 +112,11 @@ fastify.setErrorHandler(function (error, request, reply) {
this.log.error(error)
// Send error response
reply.status(500).send({ ok: false })
return
}

// pop error to default error handler
return error
})

// Run the server!
Expand Down Expand Up @@ -382,4 +386,4 @@ Impossible to load plugin because the parent (mapped directly from `avvio`)
<a name="FST_ERR_PLUGIN_TIMEOUT"></a>
#### FST_ERR_PLUGIN_TIMEOUT

Plugin did not start in time. Default timeout (in millis): `10000`
Plugin did not start in time. Default timeout (in millis): `10000`