You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to detect response status code if request was rejected by CORS?
Let's say for testing purposes my server side which is located on different domain is hardcoded to return 503 status code. Because of that - all requests rejects and catched by .catch(error => {}) but error argument is just rejecting message (TypeError: Failed to fetch), it does not contain status code and I can not find a way to detect it.
Is it possible at all?
The text was updated successfully, but these errors were encountered:
I don't think this is possible because a 503 error will be sent in response to the OPTIONS pre-flight request, which is considered part of the connection setup and unavailable to fetch or XMLHttpRequest.
Is it possible to detect response status code if request was rejected by CORS?
Let's say for testing purposes my server side which is located on different domain is hardcoded to return 503 status code. Because of that - all requests rejects and catched by
.catch(error => {})
buterror
argument is just rejecting message (TypeError: Failed to fetch), it does not contain status code and I can not find a way to detect it.Is it possible at all?
The text was updated successfully, but these errors were encountered: