error

package
v1.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxStackDepth = 50
)

Variables

This section is empty.

Functions

func RpcErrorToCordError

func RpcErrorToCordError(err error) error

func RpcErrorWithIdToCordError

func RpcErrorWithIdToCordError(err error, modelName string, id int32) error

func RpcErrorWithModelNameToCordError

func RpcErrorWithModelNameToCordError(err error, modelName string) error

func RpcErrorWithObjToCordError

func RpcErrorWithObjToCordError(err error, obj ObjectReference) error

func RpcErrorWithQueriesToCordError

func RpcErrorWithQueriesToCordError(err error, modelName string, queries map[string]string) error

func WithStackTrace

func WithStackTrace(err CordCtlError) error

Attach a stack trace to an error. The error passed in must be a pointer to an error structure for the CordCtlError interface to match.

Types

type AbortedError

type AbortedError struct {
	UserError
}

Command was aborted by the user

func (AbortedError) Error

func (f AbortedError) Error() string

type BaseError

type BaseError struct {
	Obj          ObjectReference
	Encapsulated error // in case this error encapsulates an error from a lower level
	// contains filtered or unexported fields
}

func (*BaseError) AddStackTrace

func (f *BaseError) AddStackTrace(skip int)

func (*BaseError) Stack

func (f *BaseError) Stack() string

func (*BaseError) StackFrames

func (f *BaseError) StackFrames() []go_errors.StackFrame

type ChecksumMismatchError

type ChecksumMismatchError struct {
	TransferError
	Name     string // (optional) Name of file
	Expected string
	Actual   string
}

Checksum mismatch when downloading or uploading a file

func (ChecksumMismatchError) Error

func (f ChecksumMismatchError) Error() string

type CordCtlError

type CordCtlError interface {
	error
	ShouldDumpStack() bool
	Stack() string
	AddStackTrace(skip int)
}

type FieldDoesNotExistError

type FieldDoesNotExistError struct {
	UserError
	ModelName string
	FieldName string
}

User specified a field name that is not valid

func (FieldDoesNotExistError) Error

func (f FieldDoesNotExistError) Error() string

type FilterRequiredError

type FilterRequiredError struct {
	UserError
}

Command requires a filter be specified

func (FilterRequiredError) Error

func (f FilterRequiredError) Error() string

type IllegalQueryError

type IllegalQueryError struct {
	UserError
	Query string
}

User specified a query string that is not properly formatted

func (IllegalQueryError) Error

func (f IllegalQueryError) Error() string

type InternalError

type InternalError struct {
	UnexpectedError
	Message string
}

InternalError is a catch-all for errors that don't fit somewhere else

func NewInternalError

func NewInternalError(format string, params ...interface{}) *InternalError

func (InternalError) Error

func (f InternalError) Error() string

type InvalidInputError

type InvalidInputError struct {
	UserError
	Message string
}

InvalidInputError is a catch-all for user mistakes that aren't covered elsewhere

func NewInvalidInputError

func NewInvalidInputError(format string, params ...interface{}) *InvalidInputError

func (InvalidInputError) Error

func (f InvalidInputError) Error() string

type ModelNotFoundError

type ModelNotFoundError struct {
	UserError
}

A model was not found

func (ModelNotFoundError) Error

func (f ModelNotFoundError) Error() string

type NoMatchError

type NoMatchError struct {
	UserError
}

Command was aborted by the user

func (NoMatchError) Error

func (f NoMatchError) Error() string

type ObjectReference

type ObjectReference struct {
	ModelName string
	Id        int32
	Queries   map[string]string
}

func (*ObjectReference) Clause

func (f *ObjectReference) Clause() string

Returns " on model ModelName [id]" if the reference is populated, or "" otherwise.

func (*ObjectReference) IsValid

func (f *ObjectReference) IsValid() bool

Returns true if the reference is populated

func (*ObjectReference) String

func (f *ObjectReference) String() string

type PermissionDeniedError

type PermissionDeniedError struct {
	UserError
}

Permission Denied

func (PermissionDeniedError) Error

func (f PermissionDeniedError) Error() string

type TransferError

type TransferError struct {
	BaseError
}

func (TransferError) ShouldDumpStack

func (f TransferError) ShouldDumpStack() bool

type TypeConversionError

type TypeConversionError struct {
	UnexpectedError
	Source      string
	Destination string
}

We failed to type convert something that we thought should have converted

func (TypeConversionError) Error

func (f TypeConversionError) Error() string

type UnavailableError

type UnavailableError struct {
	UserError
}

Unavailable

func (UnavailableError) Error

func (f UnavailableError) Error() string

type UnexpectedError

type UnexpectedError struct {
	BaseError
}

func (UnexpectedError) ShouldDumpStack

func (f UnexpectedError) ShouldDumpStack() bool

type UnknownModelStateError

type UnknownModelStateError struct {
	UserError
	Name string // Name of state
}

User specified a model state that is not valid

func (UnknownModelStateError) Error

func (f UnknownModelStateError) Error() string

type UnknownModelTypeError

type UnknownModelTypeError struct {
	UserError
	Name string // Name of model
}

User specified a model type that is not valid

func (UnknownModelTypeError) Error

func (f UnknownModelTypeError) Error() string

type UserError

type UserError struct {
	BaseError
}

func (UserError) ShouldDumpStack

func (f UserError) ShouldDumpStack() bool

type VersionConstraintError

type VersionConstraintError struct {
	UserError
	Name       string
	Version    string
	Constraint string
}

Version did not match a constraint

func (VersionConstraintError) Error

func (f VersionConstraintError) Error() string

Jump to

Keyboard shortcuts

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