2 ms·
Rejection is turned into an exception with "await", though. And rejection is perfectly normal with, say, network I/O.
by lobster_johnson 9y ago
Rejection is turned into an exception with "await", though. And rejection is perfectly normal with, say, network I/O.
- raquo 9y agoWell yes, that's a reasonable use case. Personally I'm not convinced that all 4xx responses should be rejections, but regardless of that, you should have about as many `catch` blocks with async-await as you have with promises.