Documentation ¶
Overview ¶
Package errors provides types and functions supporting consistent error handling.
Index ¶
- Constants
- func AlreadyExists(id string) error
- func AreaTooLarge(msg string) error
- func BadRequest(msg string) error
- func Exhausted(msg string) error
- func Interceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
- func Internal(msg string) error
- func NotFound(id string) error
- func PermissionDenied(msg string) error
- func Unauthenticated(msg string) error
- func VersionMismatch(msg string) error
Constants ¶
const ( // AreaTooLargeErr is the error that we want to signal to the http gateway // that it should return 413 to client AreaTooLargeErr codes.Code = 18 // MissingOVNs is the error to signal that an AirspaceConflictResponse should // be returned rather than the standard error response. MissingOVNs codes.Code = 19 )
Variables ¶
This section is empty.
Functions ¶
func AlreadyExists ¶
AlreadyExists returns an error used when creating a resource that already exists.
func AreaTooLarge ¶
AreaTooLarge is used when a user tries to create a resource in an area larger than the max area allowed. See geo/s2.go.
func BadRequest ¶
BadRequest returns an error that is used when a user supplies bad request parameters.
func Interceptor ¶
func Interceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
Interceptor returns a grpc.UnaryServerInterceptor that inspects outgoing errors and logs (to "logger") and replaces errors that are not *status.Status instances or status instances that indicate an internal/unknown error.
func PermissionDenied ¶
PermissionDenied returns an error representing a bad Oauth token. It can occur when a user attempts to modify a resource "owned" by a different USS.
func Unauthenticated ¶
Unauthenticated returns an error that is used when an Oauth token is invalid or not supplied.
func VersionMismatch ¶
VersionMismatch returns an error used when updating a resource with an old version.
Types ¶
This section is empty.