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

Add unauthorized error check #320

Merged
merged 1 commit into from
Nov 13, 2019
Merged

Conversation

rmweir
Copy link
Contributor

@rmweir rmweir commented Nov 12, 2019

No description provided.

@@ -120,3 +120,10 @@ func IsConflict(err error) bool {

return false
}

func IsUnauthorized(err error) bool {
if err, ok := err.(*APIError); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep this the same as the other helpers err > apiError. err indicates it's a real error when really it's the value.

@@ -120,3 +120,10 @@ func IsConflict(err error) bool {

return false
}

func IsUnauthorized(err error) bool {

Choose a reason for hiding this comment

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

should this be IsForbidden instead since it's a 403?

Copy link

@mrajashree mrajashree left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants