Skip to content

Commit

Permalink
Merge pull request #320 from rmweir/add-unauth-check
Browse files Browse the repository at this point in the history
Add unauthorized error check
  • Loading branch information
dramich authored Nov 13, 2019
2 parents 0ac7dd6 + 9589f40 commit 04dfcdb
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 IsForbidden(err error) bool {
if apiError, ok := err.(*APIError); ok {
return apiError.Code.Status == 403
}
return false
}

0 comments on commit 04dfcdb

Please sign in to comment.