script: Add message to NotFoundError (#39394)

Adding an optional message to be attached to a NotFoundError.

Testing: Just a refactor
Part of #39053

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2025-09-25 14:16:50 +02:00 committed by GitHub
parent ffdb7d3663
commit 9713bb9e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 37 additions and 38 deletions

View file

@ -337,12 +337,12 @@ impl HTMLFormElementMethods<crate::DomTypeHolder> for HTMLFormElement {
let owner = match submitters_owner {
Some(owner) => owner,
None => {
return Err(Error::NotFound);
return Err(Error::NotFound(None));
},
};
if *owner != *self {
return Err(Error::NotFound);
return Err(Error::NotFound(None));
}
submit_button

View file

@ -201,7 +201,7 @@ impl HTMLOptionsCollectionMethods<crate::DomTypeHolder> for HTMLOptionsCollectio
// Step 2
let before_node = before_element.upcast::<Node>();
if !root.is_ancestor_of(before_node) {
return Err(Error::NotFound);
return Err(Error::NotFound(None));
}
// Step 3

View file

@ -275,7 +275,7 @@ impl ScriptOrigin {
fetch_options,
type_,
unminified_dir,
import_map: Err(Error::NotFound),
import_map: Err(Error::NotFound(None)),
}
}
@ -911,7 +911,7 @@ impl HTMLScriptElement {
options,
script_type,
self.global().unminified_js_dir(),
Err(Error::NotFound),
Err(Error::NotFound(None)),
));
if was_parser_inserted &&