diff --git a/go/vt/vtadmin/errors/typed_error.go b/go/vt/vtadmin/errors/typed_error.go index defc3058fef..a538d6d25fb 100644 --- a/go/vt/vtadmin/errors/typed_error.go +++ b/go/vt/vtadmin/errors/typed_error.go @@ -40,7 +40,7 @@ type BadRequest struct { func (e *BadRequest) Error() string { return e.Err.Error() } func (e *BadRequest) Code() string { return "bad request" } func (e *BadRequest) Details() interface{} { return e.ErrDetails } -func (e *BadRequest) HTTPStatus() int { return 400 } +func (e *BadRequest) HTTPStatus() int { return http.StatusBadRequest } // Unknown is the generic error, used when a more specific error is either // unspecified or inappropriate. @@ -52,7 +52,7 @@ type Unknown struct { func (e *Unknown) Error() string { return e.Err.Error() } func (e *Unknown) Code() string { return "unknown" } func (e *Unknown) Details() interface{} { return e.ErrDetails } -func (e *Unknown) HTTPStatus() int { return 500 } +func (e *Unknown) HTTPStatus() int { return http.StatusInternalServerError } // ErrInvalidCluster is returned when a cluster parameter, either in a route or // as a query param, is invalid. @@ -63,7 +63,7 @@ type ErrInvalidCluster struct { func (e *ErrInvalidCluster) Error() string { return e.Err.Error() } func (e *ErrInvalidCluster) Code() string { return "invalid cluster" } func (e *ErrInvalidCluster) Details() interface{} { return nil } -func (e *ErrInvalidCluster) HTTPStatus() int { return 400 } +func (e *ErrInvalidCluster) HTTPStatus() int { return http.StatusBadRequest } // MissingParams is returned when an HTTP handler requires parameters that were // not provided. @@ -77,7 +77,7 @@ func (e *MissingParams) Error() string { func (e *MissingParams) Code() string { return "missing params" } func (e *MissingParams) Details() interface{} { return nil } -func (e *MissingParams) HTTPStatus() int { return 400 } +func (e *MissingParams) HTTPStatus() int { return http.StatusBadRequest } // NoSuchSchema is returned when a schema definition cannot be found for a given // set of filter criteria. Both GetSchema and FindSchema can return this error.