diff --git a/engine/resources/http.go b/engine/resources/http.go index 3be456b8..5f874e43 100644 --- a/engine/resources/http.go +++ b/engine/resources/http.go @@ -1097,6 +1097,15 @@ func (obj *httpError) Error() string { return strconv.Itoa(obj.code) + " " + obj.msg } +// newHTTPError generates a new httpError based on a single status code. It gets +// the msg text from the http.StatusText method. +func newHTTPError(code int) error { + return &httpError{ + msg: http.StatusText(code), + code: code, + } +} + // toHTTPError returns a non-specific HTTP error message and status code for a // given non-nil error value. It's important that toHTTPError does not actually // return err.Error(), since msg and httpStatus are returned to users, and