-
Notifications
You must be signed in to change notification settings - Fork 125
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
Conversation
httperror/error.go
Outdated
@@ -120,3 +120,10 @@ func IsConflict(err error) bool { | |||
|
|||
return false | |||
} | |||
|
|||
func IsUnauthorized(err error) bool { | |||
if err, ok := err.(*APIError); ok { |
There was a problem hiding this comment.
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.
6435d14
to
8aad789
Compare
httperror/error.go
Outdated
@@ -120,3 +120,10 @@ func IsConflict(err error) bool { | |||
|
|||
return false | |||
} | |||
|
|||
func IsUnauthorized(err error) bool { |
There was a problem hiding this comment.
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?
8aad789
to
9589f40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.