Sunday 8 October 2017

Async/await error handling?

Hey all!We're working on a Node.js app with express using async/await as the primary asynchronous mechanism. One thing that I'm personally having a hard time understanding is how the error handling works.With async await, I have a try catch statement wrapping the execution of the express controller (the main function) which seems to work. But im not sure how errors get bubbled up to the main function. It seems like error's are thrown within individual functions instead of popping up to the top; and if thats the case, do I need to have a try/catch statement wrapper on every function to manage errors?Any help or pointers to a resource would be greatly appreciated!

Submitted October 08, 2017 at 02:56PM by Noderly

No comments:

Post a Comment