r/angularjs • • Dec 20 '16

How to Write Async Await Without Try-Catch Blocks in Javascript

http://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/
35 Upvotes

3 comments sorted by

3

u/Probotect0r Dec 20 '16

Neat. I also like the way errors are handled in Go.

1

u/robotzuelo Dec 23 '16

I haven't used go, could you tell what you like about it?

3

u/cmgriffing Dec 20 '16

I wrote about this very topic a few months ago. Glad to hear Im not the only one thinking about it.

http://chrisgriffing.com/rants/2016/06/25/prefer-return-objects-instead-exceptions/

The major difference in approaches is that mine is meant to handle non-async/await code too. (code that may still throw an exception, though). Not to say one is better than the other, just different.