mirror of
https://github.com/rancher/norman.git
synced 2025-09-10 11:39:19 +00:00
Add unauthorized error check
This commit is contained in:
@@ -120,3 +120,10 @@ func IsConflict(err error) bool {
|
|||||||
|
|
||||||
return false
|
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