TIL With async/await, you must await a promise for try/catch to catch the error


TIL With async/await, you must await a promise for try/catch to catch the error. If you return the promise without using await, the rejected promise will be unhandled. 😳

Ouch. Easy mistake to make.

Example in codesandbox: https://codesandbox.io/s/snowy-flower-ivybc

#javascript

View original on X