MCPcopy
hub / github.com/fastify/fastify / customRouteErrorHandler

Function customRouteErrorHandler

test/route.4.test.js:16–23  ·  view source on GitHub ↗
(error, request, reply)

Source from the content-addressed store, hash-verified

14 }
15
16 const customRouteErrorHandler = (error, request, reply) => {
17 t.assert.strictEqual(error.message, 'Wrong Pot Error')
18 reply.code(418).send({
19 message: 'Make a brew',
20 statusCode: 418,
21 error: 'Wrong Pot Error'
22 })
23 }
24
25 fastify.setErrorHandler(customGlobalErrorHandler)
26

Callers

nothing calls this directly

Calls 2

sendMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected