projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15652: Eliminate a malloc when writing a one-segment block.
[arvados.git]
/
sdk
/
go
/
httpserver
/
error.go
diff --git
a/sdk/go/httpserver/error.go
b/sdk/go/httpserver/error.go
index b222e18ea1159e67b9069c086207dbc3585c8e26..f1817d3374ae11e07f4479de77b1b1b67e4b3cf9 100644
(file)
--- a/
sdk/go/httpserver/error.go
+++ b/
sdk/go/httpserver/error.go
@@
-9,6
+9,19
@@
import (
"net/http"
)
"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"`
}
type ErrorResponse struct {
Errors []string `json:"errors"`
}