18874: Add 'services/workbench2/' from commit 'f6f88d9ca9cdeeeebfadcfe999789bfb9f69e5c6'
[arvados.git] / lib / controller / router / error.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package router
6
7 type errorWithStatus struct {
8         code int
9         error
10 }
11
12 func (err errorWithStatus) HTTPStatus() int {
13         return err.code
14 }
15
16 func httpError(code int, err error) error {
17         return errorWithStatus{code: code, error: err}
18 }