MCPcopy
hub / github.com/fastify/fastify / plugin

Function plugin

test/404s.test.js:1945–1949  ·  test/404s.test.js::plugin
(fastify)

Source from the content-addressed store, hash-verified

1943 const fastify = Fastify()
1944
1945 async function plugin (fastify) {
1946 fastify.setErrorHandler(function (_, request, reply) {
1947 return reply.code(401).send({ error: class="st">'Unauthorized' })
1948 })
1949 }
1950
1951 plugin[Symbol.for(class="st">'skip-override')] = true
1952

Callers

nothing calls this directly

Calls 4

setErrorHandlerMethod · 0.80
sendMethod · 0.80
codeMethod · 0.80
setNotFoundHandlerMethod · 0.80

Tested by

no test coverage detected