fastify / fastify

Fast and low overhead web framework, for Node.js

Home Page:https://www.fastify.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

customErrorHandler is a mystery in the documentation

tmcw opened this issue · comments

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

In the documentation for onError, it mentions:

This hook will be executed only after the customErrorHandler has been executed, and only if the customErrorHandler sends an error back to the user (Note that the default customErrorHandler always sends the error back to the user).

The only other mention I can find of customErrorHandler is in the TypeScript reference, which says the same thing

I think that what both of these are referring to is the argument to setErrorHandler, which is called "Custom Error Handler", but this is a little surprisingly difficult to figure out, without a link or a searchable name.

good spot! A custom error handler is indeed what is set by setErrorHandler(). Would you like to open a PR to amend the docs?

Yep! Might be a day or two but it's on my todo list.