Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ses/error-codes/SES_UNCAUGHT_EXCEPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This behavior is configured by calling `lockdown` with the [errorTrapping][] opt

Otherwise, when thrown exceptions have no `catch` handler, the SES shim will print `SES_UNCAUGHT_EXCEPTION: exception...` to the error console. In that case, `exception...` is the thrown exception, augmented with causal error information when possible.

On some platforms, the default errorTrapping behavior reports the error, but the platform's user trapping mechanism reports only an event with no error. (See https://github.com/endojs/endo/issues/2941 test1.) In that case, non-default `errorTrapping` reports the event about the error, rather than the error itself. This often has much less relevant information than the (inaccessible) error would, but is better than nothing.

For most programs, the error console is intended for human consumption, and so the `SES_UNCAUGHT_EXCEPTION:` output can be useful in giving a clue as to the source of a failure.

[errorTrapping]: ../docs/lockdown.md#errortrapping-options
2 changes: 1 addition & 1 deletion packages/ses/src/error/tame-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const tameConsole = (
globalWindow.addEventListener('error', event => {
event.preventDefault();
// See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_UNCAUGHT_EXCEPTION.md
ourConsole.error('SES_UNCAUGHT_EXCEPTION:', event.error);
ourConsole.error('SES_UNCAUGHT_EXCEPTION:', event.error ?? event);
// 'platform' and 'report' just log the reason.
if (errorTrapping === 'exit' || errorTrapping === 'abort') {
globalWindow.location.href = `about:blank`;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.