Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(server): config is lost when reply.call not found() is called #4368

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/Reference/Server.md
Expand Up @@ -1426,6 +1426,13 @@ plugins are registered. If you would like to augment the behavior of the default
arguments `fastify.setNotFoundHandler()` within the context of these registered
plugins.

> Note: Some config properties from the request object will be
> undefined inside the custom not found handler. E.g:
> `request.routerPath`, `routerMethod` and `context.config`.
> This method design goal is to allow calling the common not found route.
> To return a per-route customized 404 response, you can do it in
> the response itself.
Comment on lines +1429 to +1434
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies to the newest APIs Request#routeSchema and Request#routeConfig.

Ref: https://www.fastify.io/docs/latest/Reference/Request/


#### setErrorHandler
<a id="set-error-handler"></a>

Expand Down