adriaandotcom / blog.adriaan.io

The tech blog of Adriaan
https://blog.adriaan.io
Other
10 stars 14 forks source link

There is no need to use [`try...catch`-statement] inside a Promise #11

Closed luizhenrique07 closed 5 years ago

luizhenrique07 commented 5 years ago

try...catch is redundant inside a Promise. If an error is thrown in the executor function, the promise is rejected.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

adriaandotcom commented 5 years ago

Thanks for your PR, it's a bit old, but still relevant:

Screenshot

Get around 1000 page views per month on that page: https://simpleanalytics.com/blog.adriaan.io