DEV Community

Discussion on: Handling JavaScript Promises with Async/Await

Collapse
 
srikanth597 profile image
srikanth597

But also be careful about catching exceptions from n/w calls.
There are 2 types of error handling with Fetch API that should be handled.

  1. Surrounding Try Catch block on Fetch request to handle client side errors.
  2. Handling Server side errors by throwing error if response staus not 2**.

With this 2 steps you will be more than safe in most cases.