14287: Merge list results from multiple backends.
[arvados.git] / sdk / go / httpserver / error.go
index b222e18ea1159e67b9069c086207dbc3585c8e26..f1817d3374ae11e07f4479de77b1b1b67e4b3cf9 100644 (file)
@@ -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"`
 }