errdefs

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errdefs provides common error definitions for gpud.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknown            = errors.New("unknown") // used internally to represent a missed mapping.
	ErrInvalidArgument    = errors.New("invalid argument")
	ErrNotFound           = errors.New("not found")
	ErrAlreadyExists      = errors.New("already exists")
	ErrFailedPrecondition = errors.New("failed precondition")
	ErrUnavailable        = errors.New("unavailable")
	ErrNotImplemented     = errors.New("not implemented") // represents not supported and unimplemented
)

Definitions of common error types used. All errors returned by most packages will map into one of these errors classes. Packages should return errors of these types when they want to instruct a client to take a particular action.

For the most part, we just try to provide local grpc errors. Most conditions map very well to those defined by grpc.

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists returns true if the error is due to an already existing metadata item

func IsCanceled

func IsCanceled(err error) bool

IsCanceled returns true if the error is due to `context.Canceled`.

func IsDeadlineExceeded

func IsDeadlineExceeded(err error) bool

IsDeadlineExceeded returns true if the error is due to `context.DeadlineExceeded`.

func IsFailedPrecondition

func IsFailedPrecondition(err error) bool

IsFailedPrecondition returns true if an operation could not proceed to the lack of a particular condition

func IsInvalidArgument

func IsInvalidArgument(err error) bool

IsInvalidArgument returns true if the error is due to an invalid argument

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error is due to a missing object

func IsNotImplemented

func IsNotImplemented(err error) bool

IsNotImplemented returns true if the error is due to not being implemented

func IsUnavailable

func IsUnavailable(err error) bool

IsUnavailable returns true if the error is due to a resource being unavailable

Types

This section is empty.

Jump to

Keyboard shortcuts

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