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

Unauthorized GitHub should raise #33

Merged
merged 3 commits into from
May 4, 2017
Merged

Unauthorized GitHub should raise #33

merged 3 commits into from
May 4, 2017

Conversation

ys
Copy link
Collaborator

@ys ys commented May 4, 2017

This PR introduce a raise_error middleware for Faraday GitHub client.
It will raise on 401 a new Escobar::Client::Error::Unauthorized.
Maybe we want to specialize errors per provider: GitHub or Heroku to differentiate them higher in the stack.

Why?

We raise RepoNotFound when the token has been revoked and return not accurate responses to users.

Another solution?

Use Octokit instead of this custom code.
That would allow us to reuse Octokit Client at places that do not fit the Escobar way:)

@ys
Copy link
Collaborator Author

ys commented May 4, 2017

@atmos atmos merged commit eeb932f into master May 4, 2017
@atmos atmos deleted the unauthorized-github branch May 4, 2017 19:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants