From dde8c7156bebe0d5ab6cc20ce596a4ab59e963c0 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 15 Apr 2015 11:26:56 -0400 Subject: [PATCH] Add a more descriptive message for 405 errors --- pkg/api/errors/errors.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/errors/errors.go b/pkg/api/errors/errors.go index 5fcfbad5f4c..9f56d658180 100644 --- a/pkg/api/errors/errors.go +++ b/pkg/api/errors/errors.go @@ -273,6 +273,9 @@ func NewGenericServerResponse(code int, verb, kind, name, serverMessage string, case http.StatusForbidden: reason = api.StatusReasonForbidden message = "the server does not allow access to the requested resource" + case http.StatusMethodNotAllowed: + reason = api.StatusReasonMethodNotAllowed + message = "the server does not allow this method on the requested resource" case StatusUnprocessableEntity: reason = api.StatusReasonInvalid message = "the server rejected our request due to an error in our request"