Provide defineErrorHandler
when writing a nitro error handler
#1922
Labels
defineErrorHandler
when writing a nitro error handler
#1922
Describe the feature
A lot of configurable functionality in nitro uses the "definer" pattern (
defineNitroConfig
,definePlugin
, etc.) to help users make type-safe definitions, provide IDE completions and you could even backport breaking changes by adding logic to the definer function that upgrades a definition passed to it.I'd say it is probably one of the most important features, as it creates a very robuust workflow for writing (runtime) code.
Strangely enough there is no such definer function for an error handler.
Instead there is the following example set by the docs:
Link to NitroErrorHandler definition
I believe this to be a mistake.
The error handler (as far as I can tell) has the same runtime as event handlers, plugins and so on.
The definer would look something like the following:
Required changes:
Additional information
The text was updated successfully, but these errors were encountered: