selectFormatter(format?: ErrorFormat | ErrorHandlerFormatter): ErrorHandlerFormatter
Resolve the error format configuration to a concrete formatter function.
- When
formatis'default','rfc9457', or the deprecated'rfc7807', the corresponding built-in formatter is returned. - When
formatis already a function, it is returned as-is. - Otherwise a
TypeErroris thrown.
optional
format: ErrorFormat | ErrorHandlerFormatter = default
The error format identifier or custom formatter function
The resolved formatter function