Skip to content

Commit 1ed6601

Browse files
committed
refine messaging
1 parent 2be8610 commit 1ed6601

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/features/jserrors/shared/cast-error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function castErrorEvent (errorEvent) {
7272
}
7373
/** SecurityPolicyViolationEvent does not exist in safari workers */
7474
if (typeof SecurityPolicyViolationEvent !== 'undefined' && errorEvent instanceof SecurityPolicyViolationEvent) {
75-
const error = new UncaughtError(errorEvent.violatedDirective, errorEvent.sourceFile, errorEvent.lineNumber, errorEvent.columnNumber, undefined, `violation of disposition: "${errorEvent.disposition}" of original policy: "${errorEvent.originalPolicy}"`)
75+
const error = new UncaughtError(`URI ${errorEvent.blockedURI} violated directive ${errorEvent.violatedDirective}`, errorEvent.sourceFile, errorEvent.lineNumber, errorEvent.columnNumber, undefined, `${errorEvent.sample || 'Unknown sample'} violated original policy: "${errorEvent.originalPolicy}"`)
7676
error.name = 'ContentSecurityPolicyViolation'
7777
return error
7878
}

0 commit comments

Comments
 (0)