-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be nice to be able to reformat error in errorHandler. It's useful when you need to modify error before sending to client, for example:
- translate
Internal server errormessage to other language - catch internal db error, expose it with a nice message
The api might be as simple as:
function formatError(error) {
// do something with error
}
errorHandler(formatError)I keep hitting this actually simple cases where I just want to format my errors before sending them to client and current errorHandler is too restrictive in what I can do. However, I'm trying to avoid writing custom middleware instead of errorHandler and struggling to find solutions.
@jaydenseric help 🙏
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request