New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly handle async errors #384
Conversation
Express is not optimized for async/await, so async errors are currently bubbled up to the main process and not properly handled. You can read more about Express error handling here: http://thecodebarbarian.com/80-20-guide-to-express-error-handling Since Probot is so async/await heavy, I think it makes sense to pull in this extension that properly handles rejected promises in Express.
Codecov Report
@@ Coverage Diff @@
## master #384 +/- ##
==========================================
- Coverage 95.03% 94.02% -1.01%
==========================================
Files 18 19 +1
Lines 262 268 +6
Branches 30 30
==========================================
+ Hits 249 252 +3
- Misses 11 14 +3
Partials 2 2 |
Using this branch on the project I'm working on and it's helped expose a bunch of issues where exceptions were being thrown in async code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - it's a cute little middleware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me. I took a look at the library and it was pretty easy to grok what's happening. I would hope this eventually makes it into express natively, or we eventually migrate to koajs, since that more naturally works with async/await.
@bkeepers bump to merge this, as we currently can't use new probot features since our project's probot dependency is pinned to this branch |
* origin/master: Customize Codecov ☂️ (#386) Remove localtunnel (#387) Use smee-client instead of EventSource directly (#389) Fix lint error introduced in #390 Document probot-config extension (#390) feature: Add early termination to paginate method (#329) docs: Update "Remix on Glitch" button link (#388) docs: How to install Node and Probot for Development (#381) [Suggestion] Use marketplace link instread of original link (#383)
I would be up for that. I haven't used koa, but definitely seems like a better fit. |
Express is not optimized for async/await, so async errors are currently bubbled up to the main process and not properly handled. You can read more about Express error handling here:
http://thecodebarbarian.com/80-20-guide-to-express-error-handling
Since Probot is so async/await heavy, I think it makes sense to pull in this extension that properly handles rejected promises in Express.