I’m using JSON.parse on a response that sometimes contains a 404 response. In the cases where it returns 404, is there a way to catch an exception and then exec
JSON.parse
You can try this:
Promise.resolve(JSON.parse(response)).then(json => { response = json ; }).catch(err => { response = response });