X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8ead06918642aa813655193d802ae82b9c363535..f94ac6e8ad9aec3c781cd71b72fcc5e2c1cedd8d:/sdk/go/httpserver/error.go diff --git a/sdk/go/httpserver/error.go b/sdk/go/httpserver/error.go index f1817d3374..75ff85336f 100644 --- a/sdk/go/httpserver/error.go +++ b/sdk/go/httpserver/error.go @@ -6,9 +6,14 @@ package httpserver import ( "encoding/json" + "fmt" "net/http" ) +func Errorf(status int, tmpl string, args ...interface{}) error { + return errorWithStatus{fmt.Errorf(tmpl, args...), status} +} + func ErrorWithStatus(err error, status int) error { return errorWithStatus{err, status} }