Question about req.multipart handler function error handling #93
-
Just wondering, was it an intentional choice not to re-throw errors within the handler function into the initial If I intentionally throw an error within the handler function to simulate random unexpected errors, neither e.g. try {
await req.multipart(async field => {
throw new Error()
})
} catch (error) {
res.status(500).end() // not triggered
}
console.log('req.multipart() basically did not error out') // this logs
res.send('OK') I guess I can just wrap the handler function itself with an error handler of its own, but it kinda feels odd |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
That was actually not intentional at all. It seems its a mistake on my end as I assumed that uncaught Promises inside of another Promise will automatically be caught by the top level promise. I just pushed a commit to resolve this issue. Let me know If the fix pushed in commit resolves your issue. |
Beta Was this translation helpful? Give feedback.
That was actually not intentional at all. It seems its a mistake on my end as I assumed that uncaught Promises inside of another Promise will automatically be caught by the top level promise. I just pushed a commit to resolve this issue. Let me know If the fix pushed in commit resolves your issue.