Javascript – How to get fetch status code when it fails with "TypeError: Failed to fetch"?
I have the following code: let response = null; try { response = await fetch(url, { method, headers: { Authorization: `Bearer ${accessToken}`, } }); console.log("Status", response?.status); } catch (e) { console.log("Error", e); console.log("Response", response); } My request fails with status…