As expected, I'm hitting some nasty problems where user code in the concurrency course can crash the app. E.g., if you write code that leaks a promise with a chaining cycle, then it will result in an unhandled rejection, which makes us show the "oops" page.
-
Show this thread
-
I think my choices here are either to fully wrap promises with my own promise that I can cancel, or else run a fully isolated VM. Really not excited about doing either of those.
3 replies 0 retweets 8 likesShow this thread -
I guess there's theoretically option (3): hope that no one actually triggers this. But it's not that difficult to make this kind of mistake...
3 replies 0 retweets 7 likesShow this thread -
If I install an "onunhandledrejection" event handler that prints `e.reason.stack`, the "stack" only contains the error message; there's no actual trace. Can I get the trace somehow?
3 replies 0 retweets 2 likesShow this thread -
It seems like I can get it if I use Bluebird with "longStackTraces" enabled. Is using Bluebird in a new app a bad idea?
1 reply 0 retweets 3 likesShow this thread -
Oh, async/await always use native promises of course. Which means no solution that involves wrapping or any third-party promise library will work. Executing outside the main app's JS context is probably the only way to handle these errors properly. I dislike this.
3 replies 0 retweets 7 likesShow this thread -
Conclusion: there seems to be literally no way to execute some JavaScript code without promise rejection errors bubbling all the way up to the top of the execution context (window). And when they get to the top, there seems to be no way to tell where they came from.
6 replies 0 retweets 10 likesShow this thread -
Replying to @garybernhardt
Is it possible for you to tag either all user created promises or all app code promises? (By tag I literally mean `promise.came_from_known_place = true`) You can access the original promise from the unhandled rejection event
1 reply 0 retweets 0 likes -
Replying to @sgrif
I can't tag user promises, but I could theoretically tag all of ours. But that would mean permanently excising all async/await from our code. And we'd have to somehow force our special promises into every promise-using library that we use. So maybe possible but very difficult.
2 replies 0 retweets 0 likes
You can mutate the browser's built in promises, so I'm not sure that it would require removing async/await. But yeah I agree with you that it'd be a huge undertaking either way
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.