📝 The gotchas of unhandled promise rejections, and how to work around them.

https://jakearchibald.com/2023/unhandled-rejections/

The gotcha of unhandled promise rejections

A rough edge with promises that can sneak up on you.

From the questions I've gotten about this, it seems there's a common misunderstanding around how .catch works:

Adding a catch handler to a promise doesn't un-reject the promise, it returns a new promise.

@jaffathecake But then creating a promise3 from promise1 with a then() without catch, promise3 won't be handled (despite promise1 "being handled"), right?
@tbroyer correct, just as promise2 is not marked as handled. then vs catch doesn't matter, the new promise always starts off unhandled.