-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ses):
errorTrapping
reports prepend "SES_UNCAUGHT_EXCEPTION:"
(
#2402) <!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description Use `"SES_UNCAUGHT_EXCEPTION: ...` report output for parity with `SES_UNHANDLED_REJECTION: ...` report output. Without this feature, `ses` would write the naked exception to stderr, which could lead to confusion when trying to understand _why_ the output was written. This was doubly confusing if the exception was not an `Error`, rather just some other thrown value. ### Security Considerations Improves security by giving more context for error output. ### Scaling Considerations n/a ### Documentation Considerations n/a ### Testing Considerations Just unit tests. ### Compatibility Considerations Since stderr is not generally parsed by programs, I am not concerned with breaking compatibility of the rendering of the uncaught exceptions. This change should improve the user experience. ### Upgrade Considerations If the stderr of your SES program is processed by another program, this change will be visible. You may need to change your error processor to be aware of `SES_UNCAUGHT_EXCEPTION: ...` output on stderr.
- Loading branch information
Showing
7 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Error output beginning with `SES_UNCAUGHT_EXCEPTION:` | ||
|
||
The SES shim provides options for management of exceptions that are not caught by any user code. | ||
|
||
This behavior is configured by calling `lockdown` with the [errorTrapping][] option. If that option is explicitly set to `'none'`, the platform's default error trap remains in effect. | ||
|
||
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. | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Error output beginning with `SES_UNHANDLED_REJECTION:` | ||
|
||
The SES shim provides options for management of rejected promises that have not had a handler attached before the promise was garbage-collected. | ||
|
||
This behavior is configured by calling `lockdown` with the [unhandledRejectionTrapping][] option. If that option is explicitly set to `'none'`, the platform's default unhandled rejection trap remains in effect. | ||
|
||
Otherwise, when unhandled rejections are detected, the SES shim will print `SES_UNHANDLED_REJECTION: reason...` to the error console. In that case, `reason...` is the rejection reason, augmented with causal error information when possible. | ||
|
||
For most programs, the error console is intended for human consumption, and so the `SES_UNHANDLED_REJECTION:` output can be useful in giving a clue as to the source of a failure. | ||
|
||
[unhandledRejectionTrapping]: ../docs/lockdown.md#unhandledrejectiontrapping-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters