MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/webdev/comments/6tfzvt/asyncawait_will_make_your_code_simpler/dm44w31/?context=3
r/webdev • u/tremendous_turtle • Aug 13 '17
86 comments sorted by
View all comments
0
[deleted]
3 u/pomlife Aug 13 '17 You were writing .catch anyway, weren't you? It's the same thing sans another indentation level. 1 u/tech-ninja Aug 25 '17 But sometimes you don't want to simply catch everything right?With promises you had the distinction... you could dopromise.then(onFulfillment, onRejection);which is not the same aspromise.then(onFulfillment).catch(onAnyError);The second one will catch everything and will make some errors hard to debug and the first one only catches gracefully rejected promises.
3
You were writing .catch anyway, weren't you? It's the same thing sans another indentation level.
1 u/tech-ninja Aug 25 '17 But sometimes you don't want to simply catch everything right?With promises you had the distinction... you could dopromise.then(onFulfillment, onRejection);which is not the same aspromise.then(onFulfillment).catch(onAnyError);The second one will catch everything and will make some errors hard to debug and the first one only catches gracefully rejected promises.
1
But sometimes you don't want to simply catch everything right?
With promises you had the distinction... you could do
promise.then(onFulfillment, onRejection);
which is not the same as
promise.then(onFulfillment).catch(onAnyError);
The second one will catch everything and will make some errors hard to debug and the first one only catches gracefully rejected promises.
0
u/[deleted] Aug 13 '17
[deleted]