mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Merge pull request #16628 from caesarxuchao/change-error-type
Auto commit by PR queue bot
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user