Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm very unconvinced considering the section on avoiding exceptions doesn't discuss async code at all. I mean, a returned Promise from an async function is very similar to the author's "Result" object where you can even pass a success handler and a rejected handler right in the single "then" method. That said, I greatly prefer instead to await on an async function and handle any rejections in a catch block.


Exceptions aren't typed though so you either have to decode it in some way or treat every exception the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: