(error)
| 198 | } |
| 199 | |
| 200 | function reject(error) { |
| 201 | if (!(error instanceof Error)) { |
| 202 | error = new customErrorTypes.AsyncError( |
| 203 | { |
| 204 | info: { |
| 205 | cause: error, |
| 206 | handler: handler._name, |
| 207 | method: req.method, |
| 208 | path: req.path ? req.path() : undefined |
| 209 | } |
| 210 | }, |
| 211 | 'Async middleware rejected without an error' |
| 212 | ); |
| 213 | } |
| 214 | return next(error); |
| 215 | } |
| 216 | |
| 217 | if (hasError && arity === 4) { |
| 218 | // error-handling middleware |