constellation: crash to a new “sad tab” error page (#30290)

* constellation: crash to a new “sad tab” page

* check in resources/crash.html

* use a separate enum variant instead of keying on reason

* fmt + tidy

* rename Resource::Crash to Resource::CrashHTML

* clean up crash page and add details (reason + backtrace)

* avoid repeating crash errors in script::script_thread warn log

* make new LoadData init more idiomatic

* clarify comments and new fields

* fix doc comment style
This commit is contained in:
Delan Azabani 2023-09-06 17:52:37 +08:00 committed by GitHub
parent 1b6351486c
commit c3c6c95a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 102 additions and 46 deletions

View file

@ -3843,7 +3843,8 @@ impl ScriptThread {
.headers(load_data.headers)
.body(load_data.data)
.redirect_mode(RedirectMode::Manual)
.origin(incomplete.origin.immutable().clone());
.origin(incomplete.origin.immutable().clone())
.crash(load_data.crash);
let context = ParserContext::new(id, load_data.url);
self.incomplete_parser_contexts
@ -3869,6 +3870,7 @@ impl ScriptThread {
) {
match fetch_metadata {
Ok(_) => (),
Err(NetworkError::Crash(..)) => (),
Err(ref e) => {
warn!("Network error: {:?}", e);
},