Documentation
¶
Index ¶
- type Error
- func (e *Error) Error() string
- func (e *Error) SetClass(c class.Class) *Error
- func (e *Error) SetDetail(detail string) *Error
- func (e *Error) SetDetailf(format string, args ...interface{}) *Error
- func (e *Error) SetOperation(operation string) *Error
- func (e *Error) WrapDetail(detail string) *Error
- func (e *Error) WrapDetailf(format string, args ...interface{}) *Error
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶ added in v0.2.1
type Error struct { // ID is a unique error instance identification number. ID uuid.UUID // Class defines the error classification. Class class.Class // Detail contains the detailed information. Detail string // InternalMessage is a message used as a string for the // golang error interface implementation. InternalMessage string // Opertaion is the operation name when the error occurred. Operation string }
Error is the common error definition used in the neuron project.
func Newf ¶ added in v0.2.1
Newf creates new error instance with provided 'class' with formatted message.
func (*Error) SetDetailf ¶ added in v0.2.1
SetDetailf sets the error's formatted detail with provided and returns itself.
func (*Error) SetOperation ¶ added in v0.2.1
SetOperation sets the error's operation and returns error by itself.
func (*Error) WrapDetail ¶ added in v0.2.1
WrapDetail wraps the 'detail' for given error. Wrapping appends the new detail to the front of error detail message.
func (*Error) WrapDetailf ¶ added in v0.2.1
WrapDetailf wraps the detail with provided formatting for given error. Wrapping appends the new detail to the front of error detail message.
type MultiError ¶ added in v0.2.1
type MultiError []*Error
MultiError is the slice of errors parsable into a single error.
func (MultiError) Error ¶ added in v0.2.1
func (m MultiError) Error() string
Error implements error interface.