mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
script: Add message to SyntaxError (#39056)
Adding an optional message to be attached to a SyntaxError. Unblocks #39050. The enum definition of Syntax is now `Syntax(Option<String>)`. Future PRs should probably add more appropriate messages to some of the `Syntax(None)`s. Testing: Just a refactor Fixes: Partially #39053 Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
d01bba4e50
commit
97c8c83cbb
30 changed files with 82 additions and 70 deletions
|
@ -270,7 +270,7 @@ impl FromStr for AdjacentPosition {
|
|||
"afterbegin" => Ok(AdjacentPosition::AfterBegin),
|
||||
"beforeend" => Ok(AdjacentPosition::BeforeEnd),
|
||||
"afterend" => Ok(AdjacentPosition::AfterEnd),
|
||||
_ => Err(Error::Syntax)
|
||||
_ => Err(Error::Syntax(None))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4068,7 +4068,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
|
|||
&selectors,
|
||||
&UrlExtraData(url.get_arc()),
|
||||
) {
|
||||
Err(_) => return Err(Error::Syntax),
|
||||
Err(_) => return Err(Error::Syntax(None)),
|
||||
Ok(selectors) => selectors,
|
||||
};
|
||||
|
||||
|
@ -4095,7 +4095,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
|
|||
&selectors,
|
||||
&UrlExtraData(url.get_arc()),
|
||||
) {
|
||||
Err(_) => return Err(Error::Syntax),
|
||||
Err(_) => return Err(Error::Syntax(None)),
|
||||
Ok(selectors) => selectors,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue