3 ms·
I've been using Babel to experience the ES6/7 world and it's a great experience to use async/await among else. Like others have said the error handling is not
by kbody 11y ago
I've been using Babel to experience the ES6/7 world and it's a great experience to use async/await among else.
Like others have said the error handling is not ok, however I want to focus on another related thing.
The use of try{}catch{} for handling errors.
Awaken by a section on Pragmatic Programmer and a post [1] of ZeroMQ's Martin Sústrik on (C) error handling.
It seems logical to me that try/catch should be used for unexpected behavior and not for expected "falsy" results which is a core case for their current use on ES6/7.
It is convenient to use try/catch compared to past alternatives, but it doesn't feel nor is designed right. Instead of just going with it, until we get terribly tired of it and do something, it's still early enough to have a proper solution in place.
Not sure if any committee is working on this or something else is planned.
[1]: http://250bpm.com/blog:4 http://250bpm.com/blog:4