diff options
author | Luke Wilde <lukew@serenityos.org> | 2023-03-23 18:37:21 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-23 20:01:38 +0100 |
commit | ddec4cd7f2237da0df4a85eb9cd7c96981b6fa74 (patch) | |
tree | acd1ac94a057c263990384c6928b863d57593dd4 /Userland | |
parent | ac5f4792a8a7ce65f3f316b15ba6ef1b24539831 (diff) | |
download | serenity-ddec4cd7f2237da0df4a85eb9cd7c96981b6fa74.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 35d3f335ea..8015d7c14d 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -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. 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. 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 {}; } |