Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe errorTaming and consoleTaming needs other adjustments #637

Merged
merged 1 commit into from Mar 25, 2021

Conversation

erights
Copy link
Contributor

@erights erights commented Mar 25, 2021

Using consoleTaming: 'unsafe' will preserve the original platform console. However, due to #636 the Node console is confused by constructor properties that have been turned into accessors. Note that we do not recommend this setting. But if you need to use it, it is best used with overrideTaming: 'min' which avoids turning any constructor properties into accessors.

The errorTaming: 'unsafe' option will avoid redacting the information normally hidden from error instances: the call stack and the detailed error message created by the assert.details template literal tag. lockdown suppresses the redaction of the details by replacing the global assert object with one whose assert.details does not redact. Thus, if you use errorTaming: 'unsafe' be sure to sample the assert object and its details field only after lockdown.

lockdown({ `errorTaming: 'unsafe'` });

// Grab `details` only after lockdown
const { details: X, quote: q } = assert;

@erights erights requested review from kumavis and FUDCo March 25, 2021 05:14
@erights erights self-assigned this Mar 25, 2021
@erights erights requested a review from kriskowal March 25, 2021 05:14
@erights erights force-pushed the markm-adjust-to-636 branch 2 times, most recently from e0be27b to a175348 Compare March 25, 2021 05:34
@erights erights changed the base branch from master to repair-552-mistake March 25, 2021 05:35
Base automatically changed from repair-552-mistake to master March 25, 2021 05:39
Copy link
Member

@kumavis kumavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delightful

@erights erights changed the title Unsafe errorTaming and consoleTaming need other adjustments Unsafe errorTaming and consoleTaming needs other adjustments Mar 25, 2021
@erights erights merged commit 70cc86e into master Mar 25, 2021
@erights erights deleted the markm-adjust-to-636 branch March 25, 2021 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants