Skip to content

Commit

Permalink
improve setErrorHandler example (#4484)
Browse files Browse the repository at this point in the history
* improve setErrorHandler example

* Update Errors.md

* review suggestion

* typo
  • Loading branch information
trim21 authored Jan 1, 2023
1 parent 0d7264c commit 0557c0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/Reference/Errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ fastify.setErrorHandler(function (error, request, reply) {
this.log.error(error)
// Send error response
reply.status(500).send({ ok: false })
} else {
// fastify will use parent error handler to handle this
reply.send(error)
}
})

Expand Down Expand Up @@ -382,4 +385,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`

0 comments on commit 0557c0a

Please sign in to comment.