-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
There was a problem hiding this 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
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}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
packages/ses/src/transforms.js
Outdated
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}`, |
There was a problem hiding this comment.
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>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
fd906c4
to
5850933
Compare
This should permit a more graceful debugging experience for censorship errors.