Hacktoberfest / hacktoberfest-2020

Hacktoberfest - App to manage the annual open-source challenge, used for the 2019 & 2020 seasons.

Home Page:https://hacktoberfest.digitalocean.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Airbrake] [Production] GET https://api.github.com/user/emails: 401 - Bad credentials // See: https://developer.github.com/v3

mkcode opened this issue · comments

Airbrake error: #3381
Airbrake project: Hacktoberfest

Error type: Octokit::Unauthorized
Error message: GET https://api.github.com/user/emails: 401 - Bad credentials // See: https://developer.github.com/v3
Where: users#registration
Occurred at: Oct 08, 2019 03:20:42 UTC
First seen at: Sep 25, 2019 17:00:03 UTC
Occurrences: 26 (0 since last deploy on <no information>)
Severity: error

URL: https://hacktoberfest.digitalocean.com/register
File: /GEM_ROOT/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb

Backtrace:

/GEM_ROOT/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in on_complete
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:9:in block in call
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:61:in on_complete
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:8:in call

Let's fix this by making a custom error page to display on this error.

We can use the same pattern demonstrated by these two commits:

  • f803460 - Call this view github_unauthorized_error instead of api_error

  • d62d072 - We rescue_from Octokit::Unauthorized instead. No need for the guard clause on line 52 in this case.

The text content on this page should ask the user to first revoke their auth token on github and point to this article: https://help.github.com/en/articles/reviewing-your-authorized-applications-oauth. If the problem persists, contact support

Thanks for the great instructions 👍

Completed in #331