-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core HTTP fetch returns incorrect error when a request is aborted #56244
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Pinging @elastic/kibana-security (Team:Security) |
While it is possible to add a check to kibana/x-pack/plugins/security/public/session/unauthorized_response_http_interceptor.ts Line 29 in 6826be2
request exists before checking request.credentials === 'omit' , I'm hesitant to do so. If there is a "response error", a "request" conceptually has to exist and the types for the HttpInterceptorResponseError have the error always being available.
|
I agree with @kobelb, this appears to be a bug in the Core HttpService. The types are not matching the runtime results. We'll prioritize fixing this on the Platform team. |
kibana/src/core/public/http/fetch.ts Lines 146 to 154 in 1bb59af
If I remember correctly, this was done to avoid loosing the
|
Yes, that's correct.
I think either of these approaches would work for our purposes in handling aborted requests. |
From a quick inspection, every check agains if (error.name === 'AbortError') {...} For consistency, adding a |
Steps to reproduce:
You'd expect the error to be thrown here to be a DOM
AbortError
, but instead you getTypeError: Cannot read property 'credentials' of undefined
.It looks like we're not properly checking if
request
exists in the unauthorized response HTTP interceptor. This probably happened here, since we were no longer throwing our own error, but forwarding along the error from the DOM.The text was updated successfully, but these errors were encountered: