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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Add error messages to thrown bare Error()s in amp-script #28185

Merged
merged 2 commits into from
May 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions extensions/amp-script/0.1/amp-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ export class AmpScript extends AMP.BaseElement {
);
// TODO(#24266): user().createError() messages are not extracted and
// don't perform string substitution.
throw new Error();
throw user().createError(
'Same-origin "src" requires "Content-Type: text/javascript" or ' +
'"Content-Type: application/javascript".'
);
}
return response.text();
} else {
Expand Down Expand Up @@ -523,7 +526,9 @@ export class AmpScriptService {
);
// TODO(#24266): user().createError() messages are not extracted and
// don't perform string substitution.
throw new Error();
throw user().createError(
'Script hash not found; sha384 missing from meta tag.'
);
}
});
}
Expand Down