Merge pull request #16628 from caesarxuchao/change-error-type

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-11-30 17:21:52 -08:00
4 changed files with 20 additions and 1 deletions

View File

@@ -157,6 +157,16 @@ func NewConflict(kind, name string, err error) error {
}}
}
// NewGone returns an error indicating the item no longer available at the server and no forwarding address is known.
func NewGone(message string) error {
return &StatusError{unversioned.Status{
Status: unversioned.StatusFailure,
Code: http.StatusGone,
Reason: unversioned.StatusReasonGone,
Message: message,
}}
}
// NewInvalid returns an error indicating the item is invalid and cannot be processed.
func NewInvalid(kind, name string, errs validation.ErrorList) error {
causes := make([]unversioned.StatusCause, 0, len(errs))