X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e6617f0bff3521135bc63b229260fdfb7b9dc331..bf08477c7e766c7692731c08212c8d1c3c5628ea:/sdk/go/httpserver/error.go?ds=sidebyside 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"` }