mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #10837 - asajeffrey:add-mozbrowsererror-details, r=Manishearth
Add detail to mozbrowsererror events. Part of #10334. Once #10824 lands, we can include the panic reason and backtrace in the error report. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10837) <!-- Reviewable:end -->
This commit is contained in:
commit
990dd72da7
4 changed files with 42 additions and 5 deletions
|
@ -433,7 +433,7 @@ pub enum MozBrowserEvent {
|
|||
/// handling `<menuitem>` element available within the browser `<iframe>`'s content.
|
||||
ContextMenu,
|
||||
/// Sent when an error occurred while trying to load content within a browser `<iframe>`.
|
||||
Error,
|
||||
Error(MozBrowserErrorType, Option<String>, Option<String>),
|
||||
/// Sent when the favicon of a browser `<iframe>` changes.
|
||||
IconChange(String, String, String),
|
||||
/// Sent when the browser `<iframe>` has reached the server.
|
||||
|
@ -466,7 +466,7 @@ impl MozBrowserEvent {
|
|||
MozBrowserEvent::Close => "mozbrowserclose",
|
||||
MozBrowserEvent::Connected => "mozbrowserconnected",
|
||||
MozBrowserEvent::ContextMenu => "mozbrowsercontextmenu",
|
||||
MozBrowserEvent::Error => "mozbrowsererror",
|
||||
MozBrowserEvent::Error(_, _, _) => "mozbrowsererror",
|
||||
MozBrowserEvent::IconChange(_, _, _) => "mozbrowsericonchange",
|
||||
MozBrowserEvent::LoadEnd => "mozbrowserloadend",
|
||||
MozBrowserEvent::LoadStart => "mozbrowserloadstart",
|
||||
|
@ -480,3 +480,21 @@ impl MozBrowserEvent {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsererror
|
||||
/// The different types of Browser error events
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum MozBrowserErrorType {
|
||||
// For the moment, we are just reporting panics, using the "fatal" type.
|
||||
/// A fatal error
|
||||
Fatal,
|
||||
}
|
||||
|
||||
impl MozBrowserErrorType {
|
||||
/// Get the name of the error type as a `& str`
|
||||
pub fn name(&self) -> &'static str {
|
||||
match *self {
|
||||
MozBrowserErrorType::Fatal => "fatal",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue