-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Support plan
- which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community, Core
- is this issue currently blocking your project? (yes/no): yes
- is this issue affecting a production system? (yes/no): no
Context
- node version: v12 v14
- module version: 20.0.3
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): hapi app
- any other relevant information: original issue failAction: detailedError to log, defaultError to response #4040
What problem are you trying to solve?
It is impossible to log detailedError to the console, defaultError to the response.
Current implementation allows:
failAction: 'error'
// defaultError to log and to response
failAction: (request, h, err) => { request.log('error', err); throw err }
// detailedError to log and to responseThere is no way to access both detailedError and defaultError in the handler.
For example:
- defaultError: Error: Invalid request query input
- detailedError: Error [ValidationError]: "foobar" is not allowed
Do you have a new or modified API suggestion to solve the problem?
if (failAction === 'log-and-error') {
request._log(options.tags, options.details || err);
throw err;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement