MCPcopy
hub / github.com/fastify/fastify / customGlobalErrorHandler

Function customGlobalErrorHandler

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

Source from the content-addressed store, hash-verified

9 const fastify = Fastify()
10
11 const customGlobalErrorHandler = (error, request, reply) => {
12 t.assert.ifError(error)
13 reply.code(429).send({ message: 'Too much coffee' })
14 }
15
16 const customRouteErrorHandler = (error, request, reply) => {
17 t.assert.strictEqual(error.message, 'Wrong Pot Error')

Callers

nothing calls this directly

Calls 2

sendMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected