Javascript – How to use fetch and catch all errors in js?
I have a fetch() call in function myFetch() (returns the fetch's return value), and would like to wrap it in another function callApi(). My goal is to make callApi() return a Promise, such that: A "resolve" state indicates success (the…