MCPcopy
hub / github.com/hapijs/hapi / failAction

Method failAction

lib/toolkit.js:117–134  ·  view source on GitHub ↗
(request, failAction, err, options)

Source from the content-addressed store, hash-verified

115 }
116
117 async failAction(request, failAction, err, options) {
118
119 const retain = options.retain ? err : undefined;
120 if (failAction === 'ignore') {
121 return retain;
122 }
123
124 if (failAction === 'log') {
125 request._log(options.tags, err);
126 return retain;
127 }
128
129 if (failAction === 'error') {
130 throw err;
131 }
132
133 return await this.execute(failAction, request, { realm: request.route.realm, args: [options.details ?? err] });
134 }
135};
136
137

Callers 3

handler.jsFile · 0.80
validation.jsFile · 0.80
route.jsFile · 0.80

Calls 2

executeMethod · 0.80
_logMethod · 0.45

Tested by

no test coverage detected