MCPcopy
hub / github.com/fastify/fastify / setErrorHandler

Method setErrorHandler

types/instance.d.ts:472–472  ·  types/instance.d.ts::FastifyInstance.setErrorHandler

* Set a function that will be invoked whenever an exception is thrown during the request lifecycle.

(
    handler: (this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>, error: TError, request: FastifyRequest<RouteGeneric, RawServer, RawRequest, SchemaCompiler, TypeProvider>, reply: FastifyReply<RouteGeneric, RawServer, RawRequest, RawReply, ContextConfigDefault, SchemaCompiler, TypeProvider>) => any | Promise<any>
  )

Source from the content-addressed store, hash-verified

470 * Set a function that will be invoked whenever an exception is thrown during the request lifecycle.
471 */
472 setErrorHandler<TError = unknown, RouteGeneric extends RouteGenericInterface = RouteGenericInterface, SchemaCompiler extends FastifySchema = FastifySchema, TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault>(
473 handler: (this: FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>, error: TError, request: FastifyRequest<RouteGeneric, RawServer, RawRequest, SchemaCompiler, TypeProvider>, reply: FastifyReply<RouteGeneric, RawServer, RawRequest, RawReply, ContextConfigDefault, SchemaCompiler, TypeProvider>) => any | Promise<any>
474 ): FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider>;
475

Callers 15

testBeforeHandlerHookFunction · 0.80
route.4.test.jsFile · 0.80
404s.test.jsFile · 0.80
pluginFunction · 0.80
500s.test.jsFile · 0.80
hooks.test.jsFile · 0.80
createNestedRoutesFunction · 0.80

Calls

no outgoing calls

Tested by 3

testBeforeHandlerHookFunction · 0.64
pluginFunction · 0.64
createNestedRoutesFunction · 0.64