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

Function customRouteErrorHandler

test/route.3.test.js:95–103  ·  view source on GitHub ↗
(error, request, reply)

Source from the content-addressed store, hash-verified

93 const fastify = Fastify()
94
95 const customRouteErrorHandler = (error, request, reply) => {
96 t.assert.strictEqual(error.message, 'Wrong Pot Error')
97
98 reply.code(418).send({
99 message: 'Make a brew',
100 statusCode: 418,
101 error: 'Wrong Pot Error'
102 })
103 }
104
105 fastify.route({
106 method: 'GET',

Callers

nothing calls this directly

Calls 2

sendMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected