Skip to content

Commit

Permalink
Merge pull request #322 from rmweir/add-unauth-check-2.4
Browse files Browse the repository at this point in the history
[Forwardport] 2.4: Add unauthorized error check
  • Loading branch information
dramich authored Nov 18, 2019
2 parents 1fcac7e + 5af9463 commit ee09ed5
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 ee09ed5

Please sign in to comment.