X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/231a86fd3f7e30e9f66d71d92ad7c26578637e37..a6fd7801f084f280cbf668f8a1f6bf9d9bbd0def:/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"` }