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

feat(ses): Censorship error messages may now contain the source name #515

Merged
merged 2 commits into from
Nov 10, 2020

Conversation

kriskowal
Copy link
Member

This should permit a more graceful debugging experience for censorship errors.

Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

LGTM, but please consider clarifying up the rejection error messages.

packages/ses/src/transforms.js Outdated Show resolved Hide resolved
const linenum = getLineNumber(src, importPattern);
if (linenum < 0) {
return src;
}
throw new SyntaxError(
`possible import expression rejected around line ${linenum}`,
`possible import expression rejected around line ${linenum} of ${name}`,
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

const linenum = getLineNumber(src, someDirectEvalPattern);
if (linenum < 0) {
return src;
}
throw new SyntaxError(
`possible direct eval expression rejected around line ${linenum}`,
`possible direct eval expression rejected around line ${linenum} of ${name}`,
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

{
name: 'SyntaxError',
message:
'possible direct eval expression rejected around line 1 of <unknown>',
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

@kriskowal kriskowal merged commit 2bcd726 into master Nov 10, 2020
@kriskowal kriskowal deleted the kris-evaluate-name branch November 10, 2020 22:40
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.

2 participants