DEV Community

Discussion on: Supplying Placeholder Data by Catching Promises

Collapse
 
avalander profile image
Avalander • Edited

Yeah, I'm a bit weary of Promises because they catch all and any errors that might happen in the rejection branch and it's hard to discriminate whether it's an error that should or shouldn't happen. That's why I switched to using Futures a while ago. You still could map the rejection branch to a default value like you suggest, but it won't mask errors that it shouldn't handle.

I was curious to see what kind of difficulties you had encountered with that, hence my question :)

Thread Thread
 
annarankin profile image
Anna Rankin

Oh, my co-worker is super into futures - he keeps pressing me to try them out. They look really interesting! Yeah, that part of Promises gets annoying; we've been having some discussions about when/what/where to catch and what to do then.