Skip to content

Commit 28599e5

Browse files
authored
feat: add exit code to render-process-gone details (electron#27580)
1 parent fdd08f7 commit 28599e5

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

docs/api/app.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ Returns:
406406
* `oom` - Process ran out of memory
407407
* `launch-failed` - Process never successfully launched
408408
* `integrity-failure` - Windows code integrity checks failed
409+
* `exitCode` Integer - The exit code of the process, unless `reason` is
410+
`launch-failed`, in which case `exitCode` will be a platform-specific
411+
launch failure error code.
409412

410413
Emitted when the renderer process unexpectedly disappears. This is normally
411414
because it was crashed or killed.

docs/api/web-contents.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ Returns:
403403
* `oom` - Process ran out of memory
404404
* `launch-failed` - Process never successfully launched
405405
* `integrity-failure` - Windows code integrity checks failed
406+
* `exitCode` Integer - The exit code of the process, unless `reason` is
407+
`launch-failed`, in which case `exitCode` will be a platform-specific
408+
launch failure error code.
406409

407410
Emitted when the renderer process unexpectedly disappears. This is normally
408411
because it was crashed or killed.

shell/browser/api/electron_api_web_contents.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@ void WebContents::RenderProcessGone(base::TerminationStatus status) {
13961396
v8::HandleScope handle_scope(isolate);
13971397
gin_helper::Dictionary details = gin_helper::Dictionary::CreateEmpty(isolate);
13981398
details.Set("reason", status);
1399+
details.Set("exitCode", web_contents()->GetCrashedErrorCode());
13991400
Emit("render-process-gone", details);
14001401
}
14011402

0 commit comments

Comments
 (0)