errors

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package errors provides types and functions supporting consistent error handling.

Index

Constants

View Source
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

func AlreadyExists(id string) error

AlreadyExists returns an error used when creating a resource that already exists.

func AreaTooLarge

func AreaTooLarge(msg string) error

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

func BadRequest(msg string) error

BadRequest returns an error that is used when a user supplies bad request parameters.

func Exhausted

func Exhausted(msg string) error

Exhausted is used when a USS creates too many resources in a given area.

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 Internal

func Internal(msg string) error

Internal returns an error that represents an internal DSS error.

func NotFound

func NotFound(id string) error

NotFound returns an error used when looking up a resource that doesn't exist.

func PermissionDenied

func PermissionDenied(msg string) error

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

func Unauthenticated(msg string) error

Unauthenticated returns an error that is used when an Oauth token is invalid or not supplied.

func VersionMismatch

func VersionMismatch(msg string) error

VersionMismatch returns an error used when updating a resource with an old version.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL