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

馃悰amp-recaptcha-input: Added support for error returning null #22456

Merged
merged 1 commit into from Jun 27, 2019

Conversation

torch2424
Copy link
Contributor

@torch2424 torch2424 commented May 23, 2019

relates to #22279

This fixes the error handler throwing an error when the err that is returned by the reCAPTCHA script is null.

EDIT: Confirmed with team directly, error can be null

Example

If I put the test code:

Screen Shot 2019-05-22 at 5 25 51 PM

It shows the error can be null:

Screen Shot 2019-05-22 at 5 25 31 PM

Just proof the script is loaded correctly:

Screen Shot 2019-05-22 at 5 24 42 PM

@@ -165,12 +165,18 @@ function actionTypeHandler(win, grecaptcha, data) {
);
},
function(err) {
user().error(TAG, '%s', err.message);
let message =
Copy link
Contributor

Choose a reason for hiding this comment

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

Ha! Interesting, Didn't know the error can be null. In such case is it still a valid error that we want to report. Or can we ignore them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the output of err is undefined, so I do think it is worth reporting. Because usually I have seen this in bugs as a configuration error with the user's recaptcha dashboard, and not an error on us 馃槃

Copy link
Contributor

Choose a reason for hiding this comment

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

SG

@torch2424
Copy link
Contributor Author

Thank you very much for the review! @zhouyx 馃槃

@torch2424 torch2424 merged commit 1724def into ampproject:master Jun 27, 2019
@torch2424 torch2424 deleted the 3p-recaptcha-error branch June 27, 2019 22:22
thekorn pushed a commit to edelight/amphtml that referenced this pull request Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants