https://toxigon.com/handling-api-errors-javascript
Handling API Errors in JavaScript