mirror of
https://github.com/rancher/norman.git
synced 2025-09-18 16:35:19 +00:00
Merge pull request #322 from rmweir/add-unauth-check-2.4
[Forwardport] 2.4: Add unauthorized error check
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user