mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-05 05:56:53 +03:00
LibWeb/Fetch: Pass error from ResourceLoader into network_error
This commit is contained in:
parent
b83e82c32c
commit
4e6eb35520
Notes:
sideshowbarker
2024-07-17 02:05:41 +09:00
Author: https://github.com/circl-lastname Commit: https://github.com/LadybirdBrowser/ladybird/commit/4e6eb35520 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/209 Reviewed-by: https://github.com/ADKaster ✅
@ -2226,7 +2226,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_load
|
||||
auto response = Infrastructure::Response::create(vm);
|
||||
// FIXME: This is ugly, ResourceLoader should tell us.
|
||||
if (status_code.value_or(0) == 0) {
|
||||
response = Infrastructure::Response::network_error(vm, "HTTP request failed"_string);
|
||||
response = Infrastructure::Response::network_error(vm, TRY_OR_IGNORE(String::from_byte_string(error)));
|
||||
} else {
|
||||
response->set_type(Infrastructure::Response::Type::Error);
|
||||
response->set_status(status_code.value_or(400));
|
||||
|
Loading…
Reference in New Issue
Block a user