| Index: go/src/infra/libs/gitiles/statusError.go
|
| diff --git a/go/src/infra/libs/gitiles/statusError.go b/go/src/infra/libs/gitiles/statusError.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..62c106d2e8b5054f57e96c6d92e3966b1cb404df
|
| --- /dev/null
|
| +++ b/go/src/infra/libs/gitiles/statusError.go
|
| @@ -0,0 +1,18 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package gitiles
|
| +
|
| +import (
|
| + "fmt"
|
| +)
|
| +
|
| +// StatusError is a simple error type which wraps a Http StatusCode.
|
| +type StatusError int
|
| +
|
| +// Member functions ////////////////////////////////////////////////////////////
|
| +
|
| +// Bad returns true iff the status code is not 2XX
|
| +func (s StatusError) Bad() bool { return s < 200 || s >= 300 }
|
| +func (s StatusError) Error() string { return fmt.Sprintf("got status code %d", s) }
|
|
|