mirror of
https://github.com/rancher/norman.git
synced 2025-09-01 07:08:59 +00:00
Send k8s error bad as something other than 500 server error
This commit is contained in:
@@ -46,6 +46,13 @@ type APIError struct {
|
||||
fieldName string
|
||||
}
|
||||
|
||||
func NewAPIErrorLong(status int, code, message string) error {
|
||||
return NewAPIError(ErrorCode{
|
||||
code: code,
|
||||
status: status,
|
||||
}, message)
|
||||
}
|
||||
|
||||
func NewAPIError(code ErrorCode, message string) error {
|
||||
return &APIError{
|
||||
code: code,
|
||||
|
Reference in New Issue
Block a user