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

Timeout related error message is unclear #436

Open
Jhunter1 opened this issue Jan 3, 2024 · 2 comments
Open

Timeout related error message is unclear #436

Jhunter1 opened this issue Jan 3, 2024 · 2 comments

Comments

@Jhunter1
Copy link

Jhunter1 commented Jan 3, 2024

We recently had an issue with a slow DNS lookup (10 seconds) on our Ruby on Rails web server which caused the code to timeout and fail after about 10 seconds. This error message could be made clearer I think for future users facing similar issues?

"Oops, we failed to validate your reCAPTCHA response. Please try again."

https://github.com/ambethia/recaptcha/blob/master/test/verify_test.rb

@grosser
Copy link
Collaborator

grosser commented Jan 3, 2024 via email

@Jhunter1
Copy link
Author

Jhunter1 commented Jan 3, 2024

In our case the client doesn't get a 500 error - they only get the custom error message that has been added to our website's code. The error from the recaptcha Gem is "Oops, we failed to validate your reCAPTCHA response. Please try again." and we send that to a log file/Rails.logger.warn as shown below:

if verify_recaptcha(model: @user)
      @user.deliver_reset_password_instructions! if @user
      redirect_to(root_path, :notice => 'Instructions have been sent to your email.')
    else
        Rails.logger.warn("recapthca error #{@user.errors.full_messages}")
        flash[:alert] = "recaptcha not verified!"
        render :action => :new
    end

I am not a full time dev so I will leave it up to you to decide if it is worth changing the error message and if it can be helpful for others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants