X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/380a54a7d97b34119cbaa3bee05d6b6cd241eee5..15aa3f9e8de69cb638bad461628f115f8a5bc276:/sdk/go/httpserver/error.go diff --git a/sdk/go/httpserver/error.go b/sdk/go/httpserver/error.go index b222e18ea1..f1817d3374 100644 --- a/sdk/go/httpserver/error.go +++ b/sdk/go/httpserver/error.go @@ -9,6 +9,19 @@ import ( "net/http" ) +func ErrorWithStatus(err error, status int) error { + return errorWithStatus{err, status} +} + +type errorWithStatus struct { + error + Status int +} + +func (ews errorWithStatus) HTTPStatus() int { + return ews.Status +} + type ErrorResponse struct { Errors []string `json:"errors"` }