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

Make amp-form failure message developer-friendlier #35964

Merged
merged 2 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ssr-template-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class SsrTemplateHelper {
if (this.isEnabled()) {
userAssert(
typeof data['html'] === 'string',
'Server side html response must be defined'
'Skipping template rendering due to failed fetch'
Copy link
Contributor

Choose a reason for hiding this comment

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

Side-nit: This maybe should instead be user().assertString(data['html'], '...');

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks - since that's unrelated to this PR I will leave that out of the current PR but feel free to change that in a separate PR or track it separately!

);
renderTemplatePromise = this.assertTrustedViewer(element).then(() => {
return this.templates_.findAndSetHtmlForTemplate(
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test-ssr-template-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describes.fakeWin(
allowConsoleError(() => {
expect(() => {
ssrTemplateHelper.applySsrOrCsrTemplate({}, {html: null});
}).to.throw(/Server side html response must be defined/);
}).to.throw(/Skipping template rendering due to failed fetch/);
});
});

Expand Down