Browse Source

feat: add exit code to render-process-gone details (#27677)

Co-authored-by: Jeremy Rose <[email protected]>
trop[bot] 4 years ago
parent
commit
8cdd20e97a
3 changed files with 7 additions and 0 deletions
  1. 3 0
      docs/api/app.md
  2. 3 0
      docs/api/web-contents.md
  3. 1 0
      shell/browser/api/electron_api_web_contents.cc

+ 3 - 0
docs/api/app.md

@@ -406,6 +406,9 @@ Returns:
     * `oom` - Process ran out of memory
     * `launch-failed` - Process never successfully launched
     * `integrity-failure` - Windows code integrity checks failed
+  * `exitCode` Integer - The exit code of the process, unless `reason` is
+    `launch-failed`, in which case `exitCode` will be a platform-specific
+    launch failure error code.
 
 Emitted when the renderer process unexpectedly disappears.  This is normally
 because it was crashed or killed.

+ 3 - 0
docs/api/web-contents.md

@@ -402,6 +402,9 @@ Returns:
     * `oom` - Process ran out of memory
     * `launch-failed` - Process never successfully launched
     * `integrity-failure` - Windows code integrity checks failed
+  * `exitCode` Integer - The exit code of the process, unless `reason` is
+    `launch-failed`, in which case `exitCode` will be a platform-specific
+    launch failure error code.
 
 Emitted when the renderer process unexpectedly disappears.  This is normally
 because it was crashed or killed.

+ 1 - 0
shell/browser/api/electron_api_web_contents.cc

@@ -1392,6 +1392,7 @@ void WebContents::RenderProcessGone(base::TerminationStatus status) {
   v8::HandleScope handle_scope(isolate);
   gin_helper::Dictionary details = gin_helper::Dictionary::CreateEmpty(isolate);
   details.Set("reason", status);
+  details.Set("exitCode", web_contents()->GetCrashedErrorCode());
   Emit("render-process-gone", details);
 }