Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.

Commit 6795265

Browse files
authored
Merge pull request #461 from digitalocean/kjuell/github-signin-errors
Add error handling for GitHub 503s
2 parents 4ea80c4 + ac9792c commit 6795265

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

app/controllers/application_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
44
before_action :set_current_user
55
rescue_from Faraday::ClientError, with: :api_error
66
rescue_from Octokit::Unauthorized, with: :github_unauthorized_error
7+
rescue_from Octokit::ServerError, with: :api_error
8+
rescue_from Octokit::AccountSuspended, with: :github_suspended_error
79

810
def current_user
911
return unless logged_in?
@@ -62,4 +64,8 @@ def api_error(error)
6264
def github_unauthorized_error
6365
render 'pages/github_unauthorized_error', status: :unauthorized
6466
end
67+
68+
def github_suspended_error
69+
render 'pages/github_suspended_error', status: :forbidden
70+
end
6571
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div class="section">
2+
<div class="container">
3+
<div class="details">
4+
5+
<h1 class="title is-1">Something went wrong when talking to GitHub...</h1>
6+
<p>
7+
It looks like your GitHub account has been suspended.
8+
</p>
9+
10+
<br/>
11+
<br/>
12+
<div class="line-br is-hidden-touch">
13+
<span class="line-br-1">-</span>
14+
<span class="line-br-2">-</span>
15+
</div>
16+
<br/>
17+
18+
<h3 class="title is-3">
19+
Here's what you should try doing to see if we can get this sorted:
20+
</h3>
21+
22+
<p>
23+
<span class="highlight"></span> <a href="https://support.github.com/contact">Create a support ticket</a>.
24+
</p>
25+
<p>
26+
<span class="highlight"></span> If the problem persists, please let us know by emailing
27+
<a href="mailto:hacktoberfest@digitalocean.com">hacktoberfest@digitalocean.com</a>.
28+
</p>
29+
30+
</div>
31+
</div>
32+
</div>

0 commit comments

Comments
 (0)