mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
LibWeb: Require error message for Response::network_error()
There will be a lot of different cases where we'll return an error response, and having a customized Promise rejection message seems quite useful. Note that this has to be distinct from the existing 'status message', which is required to be empty in those cases.
This commit is contained in:
parent
d8ebdef010
commit
32e0f0aec8
3 changed files with 12 additions and 6 deletions
|
@ -154,7 +154,7 @@ JS::NonnullGCPtr<Response> Response::error(JS::VM& vm)
|
|||
{
|
||||
// The static error() method steps are to return the result of creating a Response object, given a new network error, "immutable", and this’s relevant Realm.
|
||||
// FIXME: How can we reliably get 'this', i.e. the object the function was called on, in IDL-defined functions?
|
||||
return Response::create(*vm.current_realm(), Infrastructure::Response::network_error(vm), Headers::Guard::Immutable);
|
||||
return Response::create(*vm.current_realm(), Infrastructure::Response::network_error(vm, "Response created via `Response.error()`"sv), Headers::Guard::Immutable);
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#dom-response-redirect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue