errors

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(err error, needle string) bool

Contains compares the error message with needle

func IsDeadlineExceeded

func IsDeadlineExceeded(err error) bool

func IsErrorAlreadyExists

func IsErrorAlreadyExists(err error) bool

func IsErrorInvalidArgument

func IsErrorInvalidArgument(err error) bool

func IsInternal

func IsInternal(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsPermissionDenied

func IsPermissionDenied(err error) bool

func IsPreconditionFailed

func IsPreconditionFailed(err error) bool

func IsUnauthenticated

func IsUnauthenticated(err error) bool

func IsUnavailable

func IsUnavailable(err error) bool

func IsUnimplemented

func IsUnimplemented(err error) bool

func IsUnknown

func IsUnknown(err error) bool

func ThrowAlreadyExists

func ThrowAlreadyExists(parent error, id, message string) error

func ThrowAlreadyExistsf

func ThrowAlreadyExistsf(parent error, id, format string, a ...interface{}) error

func ThrowDeadlineExceeded

func ThrowDeadlineExceeded(parent error, id, message string) error

func ThrowDeadlineExceededf

func ThrowDeadlineExceededf(parent error, id, format string, a ...interface{}) error

func ThrowError

func ThrowError(parent error, id, message string) error

func ThrowInternal

func ThrowInternal(parent error, id, message string) error

func ThrowInternalf

func ThrowInternalf(parent error, id, format string, a ...interface{}) error

func ThrowInvalidArgument

func ThrowInvalidArgument(parent error, id, message string) error

func ThrowInvalidArgumentf

func ThrowInvalidArgumentf(parent error, id, format string, a ...interface{}) error

func ThrowNotFound

func ThrowNotFound(parent error, id, message string) error

func ThrowNotFoundf

func ThrowNotFoundf(parent error, id, format string, a ...interface{}) error

func ThrowPermissionDenied

func ThrowPermissionDenied(parent error, id, message string) error

func ThrowPermissionDeniedf

func ThrowPermissionDeniedf(parent error, id, format string, a ...interface{}) error

func ThrowPreconditionFailed

func ThrowPreconditionFailed(parent error, id, message string) error

func ThrowPreconditionFailedf

func ThrowPreconditionFailedf(parent error, id, format string, a ...interface{}) error

func ThrowUnauthenticated

func ThrowUnauthenticated(parent error, id, message string) error

func ThrowUnauthenticatedf

func ThrowUnauthenticatedf(parent error, id, format string, a ...interface{}) error

func ThrowUnavailable

func ThrowUnavailable(parent error, id, message string) error

func ThrowUnavailablef

func ThrowUnavailablef(parent error, id, format string, a ...interface{}) error

func ThrowUnimplemented

func ThrowUnimplemented(parent error, id, message string) error

func ThrowUnimplementedf

func ThrowUnimplementedf(parent error, id, format string, a ...interface{}) error

func ThrowUnknown

func ThrowUnknown(parent error, id, message string) error

func ThrowUnknownf

func ThrowUnknownf(parent error, id, format string, a ...interface{}) error

Types

type AlreadyExists

type AlreadyExists interface {
	error
	IsAlreadyExists()
}

type AlreadyExistsError

type AlreadyExistsError struct {
	*CaosError
}

func (*AlreadyExistsError) Is

func (err *AlreadyExistsError) Is(target error) bool

func (*AlreadyExistsError) IsAlreadyExists

func (err *AlreadyExistsError) IsAlreadyExists()

func (*AlreadyExistsError) Unwrap

func (err *AlreadyExistsError) Unwrap() error

type CaosError

type CaosError struct {
	Parent  error
	Message string
	ID      string
}

func CreateCaosError

func CreateCaosError(parent error, id, message string) *CaosError

func (*CaosError) As

func (err *CaosError) As(target interface{}) bool

func (*CaosError) Error

func (err *CaosError) Error() string

func (*CaosError) GetID

func (err *CaosError) GetID() string

func (*CaosError) GetMessage

func (err *CaosError) GetMessage() string

func (*CaosError) GetParent

func (err *CaosError) GetParent() error

func (*CaosError) Is

func (err *CaosError) Is(target error) bool

func (*CaosError) SetMessage

func (err *CaosError) SetMessage(msg string)

func (*CaosError) Unwrap

func (err *CaosError) Unwrap() error

type DeadlineExceeded

type DeadlineExceeded interface {
	error
	IsDeadlineExceeded()
}

type DeadlineExceededError

type DeadlineExceededError struct {
	*CaosError
}

func (*DeadlineExceededError) Is

func (err *DeadlineExceededError) Is(target error) bool

func (*DeadlineExceededError) IsDeadlineExceeded

func (err *DeadlineExceededError) IsDeadlineExceeded()

func (*DeadlineExceededError) Unwrap

func (err *DeadlineExceededError) Unwrap() error

type Error

type Error interface {
	GetParent() error
	GetMessage() string
	SetMessage(string)
	GetID() string
}

Error is a stdlib error extension. It contains parameters to identify errors through all application layers

type Internal

type Internal interface {
	error
	IsInternal()
}

type InternalError

type InternalError struct {
	*CaosError
}

func (*InternalError) Is

func (err *InternalError) Is(target error) bool

func (*InternalError) IsInternal

func (err *InternalError) IsInternal()

func (*InternalError) Unwrap

func (err *InternalError) Unwrap() error

type InvalidArgument

type InvalidArgument interface {
	error
	IsInvalidArgument()
}

type InvalidArgumentError

type InvalidArgumentError struct {
	*CaosError
}

func (*InvalidArgumentError) Is

func (err *InvalidArgumentError) Is(target error) bool

func (*InvalidArgumentError) IsInvalidArgument

func (err *InvalidArgumentError) IsInvalidArgument()

func (*InvalidArgumentError) Unwrap

func (err *InvalidArgumentError) Unwrap() error

type NotFound

type NotFound interface {
	error
	IsNotFound()
}

type NotFoundError

type NotFoundError struct {
	*CaosError
}

func (*NotFoundError) Is

func (err *NotFoundError) Is(target error) bool

func (*NotFoundError) IsNotFound

func (err *NotFoundError) IsNotFound()

func (*NotFoundError) Unwrap

func (err *NotFoundError) Unwrap() error

type PermissionDenied

type PermissionDenied interface {
	error
	IsPermissionDenied()
}

type PermissionDeniedError

type PermissionDeniedError struct {
	*CaosError
}

func (*PermissionDeniedError) Is

func (err *PermissionDeniedError) Is(target error) bool

func (*PermissionDeniedError) IsPermissionDenied

func (err *PermissionDeniedError) IsPermissionDenied()

func (*PermissionDeniedError) Unwrap

func (err *PermissionDeniedError) Unwrap() error

type PreconditionFailed

type PreconditionFailed interface {
	error
	IsPreconditionFailed()
}

type PreconditionFailedError

type PreconditionFailedError struct {
	*CaosError
}

func (*PreconditionFailedError) Is

func (err *PreconditionFailedError) Is(target error) bool

func (*PreconditionFailedError) IsPreconditionFailed

func (err *PreconditionFailedError) IsPreconditionFailed()

func (*PreconditionFailedError) Unwrap

func (err *PreconditionFailedError) Unwrap() error

type Unauthenticated

type Unauthenticated interface {
	error
	IsUnauthenticated()
}

type UnauthenticatedError

type UnauthenticatedError struct {
	*CaosError
}

func (*UnauthenticatedError) Is

func (err *UnauthenticatedError) Is(target error) bool

func (*UnauthenticatedError) IsUnauthenticated

func (err *UnauthenticatedError) IsUnauthenticated()

func (*UnauthenticatedError) Unwrap

func (err *UnauthenticatedError) Unwrap() error

type Unavailable

type Unavailable interface {
	error
	IsUnavailable()
}

type UnavailableError

type UnavailableError struct {
	*CaosError
}

func (*UnavailableError) Is

func (err *UnavailableError) Is(target error) bool

func (*UnavailableError) IsUnavailable

func (err *UnavailableError) IsUnavailable()

func (*UnavailableError) Unwrap

func (err *UnavailableError) Unwrap() error

type Unimplemented

type Unimplemented interface {
	error
	IsUnimplemented()
}

type UnimplementedError

type UnimplementedError struct {
	*CaosError
}

func (*UnimplementedError) Is

func (err *UnimplementedError) Is(target error) bool

func (*UnimplementedError) IsUnimplemented

func (err *UnimplementedError) IsUnimplemented()

func (*UnimplementedError) Unwrap

func (err *UnimplementedError) Unwrap() error

type Unknown

type Unknown interface {
	error
	IsUnknown()
}

type UnknownError

type UnknownError struct {
	*CaosError
}

func (*UnknownError) Is

func (err *UnknownError) Is(target error) bool

func (*UnknownError) IsUnknown

func (err *UnknownError) IsUnknown()

func (*UnknownError) Unwrap

func (err *UnknownError) Unwrap() error

Directories

Path Synopsis
go generate
go generate

Jump to

Keyboard shortcuts

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