mirror of
https://github.com/rancher/norman.git
synced 2025-09-08 18:49:31 +00:00
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