errors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Report

func Report(err error, source string, log contract.Logger)

Report reports errors.

Types

type Base

type Base struct {
	TheCause  error
	Details   string
	TheCaller string
}

Base is a generic error used within Oasis. Having it's root cause is what makes it good.

func NewBase

func NewBase(cause error, details string) Base

NewBase creates a new Base instance.

func (Base) Caller

func (err Base) Caller() string

Caller returns path t a file where the error has been created.

func (Base) Cause

func (err Base) Cause() error

Cause returns an cause error instance.

func (Base) Error

func (err Base) Error() string

Error returns a string representation of an error.

type ErrGraphHasCycles

type ErrGraphHasCycles struct {
	Base
	Cycles *collection.NodeStack
}

ErrGraphHasCycles means an execution graph is not a DAG.

func GraphHasCycles

func GraphHasCycles(cycle *collection.NodeStack, cause error) ErrGraphHasCycles

GraphHasCycles creates a new ErrGraphHasCycles error instance.

func (ErrGraphHasCycles) Error

func (err ErrGraphHasCycles) Error() string

type ErrInvalidResponse

type ErrInvalidResponse struct {
	Base
}

ErrInvalidResponse may be returned from response-related methods of specs.

func InvalidResponse

func InvalidResponse(details string, cause error) ErrInvalidResponse

InvalidResponse creates a new ErrInvalidResponse error instance.

func (ErrInvalidResponse) Error

func (err ErrInvalidResponse) Error() string

type ErrInvalidSchema

type ErrInvalidSchema struct {
	Base
	SchemaName string
}

ErrInvalidSchema may be returned from schema-related methods of specs.

func InvalidSchema

func InvalidSchema(sn string, details string, cause error) ErrInvalidSchema

InvalidSchema creates a new ErrInvalidSchema error instance.

func (ErrInvalidSchema) Error

func (err ErrInvalidSchema) Error() string

type ErrNoParameters

type ErrNoParameters struct {
	Base
	Kind          string
	MissingParams []string
}

ErrNoParameters happens when there are parameters missing which are needed to build an operation before testing. Usually happens in paths, queries & headers.

func NoParameters

func NoParameters(missingParams []string, kind string, cause error) ErrNoParameters

NoParameters creates a new ErrNoData error instance.

func (ErrNoParameters) Error

func (err ErrNoParameters) Error() string

type ErrNoProperty

type ErrNoProperty struct {
	Base
	// contains filtered or unexported fields
}

ErrNoProperty happens when a property was not found in an object.

func NoProperty

func NoProperty(prop string, cause error) ErrNoProperty

NoProperty creates a new ErrNoProperty error instance.

func (ErrNoProperty) Error

func (err ErrNoProperty) Error() string

type ErrNotAn

type ErrNotAn struct {
	Base
	// contains filtered or unexported fields
}

ErrNotAn happens when something is not what it appears to be.

func NotAn

func NotAn(whatShouldBe string, whatIs interface{}, cause error) ErrNotAn

NotAn creates a new ErrNotAn error instance.

func (ErrNotAn) Error

func (err ErrNotAn) Error() string

type ErrNotFound

type ErrNotFound struct {
	Base
	What string
	Name string
}

ErrNotFound may be returned from host-related methods of specs.

func NotFound

func NotFound(what string, hn string, cause error) ErrNotFound

NotFound creates a new ErrHostNotFound error instance.

func (ErrNotFound) Error

func (err ErrNotFound) Error() string

type ErrOops

type ErrOops struct {
	Base
}

ErrOops is a generic error with a message.

func Oops

func Oops(msg string, cause error) ErrOops

Oops creates a new ErrOops error instance.

func (ErrOops) Error

func (err ErrOops) Error() string

type ErrOperationMalformed

type ErrOperationMalformed struct {
	Base
	OpID    string
	Details string
}

ErrOperationMalformed is returned when there is not enough data in the API spec, or the data is incorrect, which makes operation creation impossible.

func OperationMalformed

func OperationMalformed(id string, details string, cause error) ErrOperationMalformed

OperationMalformed creates a new ErrOperationMalformed error instance.

func (ErrOperationMalformed) Error

func (err ErrOperationMalformed) Error() string

type ErrOutOfRange

type ErrOutOfRange struct {
	Base
	// contains filtered or unexported fields
}

ErrOutOfRange happens when an array index is out of range.

func OutOfRange

func OutOfRange(i int, a *[]interface{}, cause error) ErrOutOfRange

OutOfRange creates a new ErrOutOfRange error instance.

func (ErrOutOfRange) Error

func (err ErrOutOfRange) Error() string

type ErrSecurityNotFound

type ErrSecurityNotFound struct {
	Base
	Name string
}

ErrSecurityNotFound may be returned from security-related methods of specs.

func SecurityNotFound

func SecurityNotFound(sn string, details string, cause error) ErrSecurityNotFound

SecurityNotFound creates a new ErrSecurityNotFound error instance.

func (ErrSecurityNotFound) Error

func (err ErrSecurityNotFound) Error() string

type IError

type IError interface {
	Error() string
	Cause() error
	Caller() string
}

IError is an error interface.

type NullObjectPrototype

type NullObjectPrototype struct {
	Log   contract.Logger
	Error error
}

NullObjectPrototype is a prototype implementation of null entities, such as NullSpec and NullOperation.

func NullObject

func NullObject(err error, log contract.Logger) NullObjectPrototype

NullObject creates a new NullONullObjectPrototype instance.

func (NullObjectPrototype) Report

func (null NullObjectPrototype) Report()

Report reports the contained error.

Jump to

Keyboard shortcuts

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