chore: surface webcontents load error more readily (#22824)
This commit is contained in:
parent
9deae1c3c4
commit
ceda33dd5e
1 changed files with 8 additions and 1 deletions
|
@ -118,6 +118,7 @@
|
||||||
#include "shell/common/mouse_util.h"
|
#include "shell/common/mouse_util.h"
|
||||||
#include "shell/common/node_includes.h"
|
#include "shell/common/node_includes.h"
|
||||||
#include "shell/common/options_switches.h"
|
#include "shell/common/options_switches.h"
|
||||||
|
#include "shell/common/process_util.h"
|
||||||
#include "shell/common/v8_value_serializer.h"
|
#include "shell/common/v8_value_serializer.h"
|
||||||
#include "storage/browser/file_system/isolated_context.h"
|
#include "storage/browser/file_system/isolated_context.h"
|
||||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||||
|
@ -1656,9 +1657,15 @@ void WebContents::DidFinishNavigation(
|
||||||
frame_process_id, frame_routing_id);
|
frame_process_id, frame_routing_id);
|
||||||
|
|
||||||
// Do not emit "did-fail-load" for canceled requests.
|
// Do not emit "did-fail-load" for canceled requests.
|
||||||
if (code != net::ERR_ABORTED)
|
if (code != net::ERR_ABORTED) {
|
||||||
|
EmitWarning(
|
||||||
|
node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate()),
|
||||||
|
"Failed to load URL: " + url.possibly_invalid_spec() +
|
||||||
|
" with error: " + description,
|
||||||
|
"electron");
|
||||||
Emit("did-fail-load", code, description, url, is_main_frame,
|
Emit("did-fail-load", code, description, url, is_main_frame,
|
||||||
frame_process_id, frame_routing_id);
|
frame_process_id, frame_routing_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue