1
0
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:
Darren Shepherd
2017-12-29 15:07:20 -07:00
parent 162f6088af
commit b5ebee3dfa
4 changed files with 79 additions and 2 deletions

View File

@@ -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,