Skip to content

Commit

Permalink
Add unauthorized error check
Browse files Browse the repository at this point in the history
  • Loading branch information
rmweir committed Nov 12, 2019
1 parent 0ac7dd6 commit 8aad789
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions httperror/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,10 @@ func IsConflict(err error) bool {

return false
}

func IsUnauthorized(err error) bool {
if apiError, ok := err.(*APIError); ok {
return apiError.Code.Status == 403
}
return false
}

0 comments on commit 8aad789

Please sign in to comment.