mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 13:17:36 +00:00
LibWeb: Create the correct error objects in XHR::handle_errors
Aborts and network errors were accidentally creating TimeoutError exceptions instead of AbortError and NetworkError respectively.
This commit is contained in:
parent
ac5f4792a8
commit
ddec4cd7f2
1 changed files with 2 additions and 2 deletions
|
@ -1112,11 +1112,11 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::handle_errors()
|
||||||
|
|
||||||
// 3. Otherwise, if xhr’s response’s aborted flag is set, run the request error steps for xhr, abort, and "AbortError" DOMException.
|
// 3. Otherwise, if xhr’s response’s aborted flag is set, run the request error steps for xhr, abort, and "AbortError" DOMException.
|
||||||
if (m_response->aborted())
|
if (m_response->aborted())
|
||||||
return TRY(request_error_steps(EventNames::abort, WebIDL::TimeoutError::create(realm(), "Aborted"sv)));
|
return TRY(request_error_steps(EventNames::abort, WebIDL::AbortError::create(realm(), "Aborted"sv)));
|
||||||
|
|
||||||
// 4. Otherwise, if xhr’s response is a network error, then run the request error steps for xhr, error, and "NetworkError" DOMException.
|
// 4. Otherwise, if xhr’s response is a network error, then run the request error steps for xhr, error, and "NetworkError" DOMException.
|
||||||
if (m_response->is_network_error())
|
if (m_response->is_network_error())
|
||||||
return TRY(request_error_steps(EventNames::error, WebIDL::TimeoutError::create(realm(), "Network error"sv)));
|
return TRY(request_error_steps(EventNames::error, WebIDL::NetworkError::create(realm(), "Network error"sv)));
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue