Versions in this module Expand all Collapse all v1 v1.2.1 Aug 8, 2023 Changes in this version + var AssertionFailed = CommonErrors.NewType("assertion_failed") + var CommonErrors = NewNamespace("common") + var ConcurrentUpdate = CommonErrors.NewType("concurrent_update") + var DataUnavailable = CommonErrors.NewType("data_unavailable") + var ExternalError = CommonErrors.NewType("external_error") + var IllegalArgument = CommonErrors.NewType("illegal_argument") + var IllegalFormat = CommonErrors.NewType("illegal_format") + var IllegalState = CommonErrors.NewType("illegal_state") + var InitializationFailed = CommonErrors.NewType("initialization_failed") + var InternalError = CommonErrors.NewType("internal_error") + var Interrupted = CommonErrors.NewType("interrupted") + var NotImplemented = UnsupportedOperation.NewSubtype("not_implemented") + var RejectedOperation = CommonErrors.NewType("rejected_operation") + var TimeoutElapsed = CommonErrors.NewType("timeout", Timeout()) + var UnsupportedOperation = CommonErrors.NewType("unsupported_operation") + var UnsupportedVersion = UnsupportedOperation.NewSubtype("version") + func DecorateMany(message string, errs ...error) error + func ErrorFromPanic(recoverResult interface{}) (error, bool) + func ExtractContext(err error) (context.Context, bool) + func ExtractPayload(err error) (interface{}, bool) + func ExtractProperty(err error, key Property) (interface{}, bool) + func GetTypeName(err error) string + func HasTrait(err error, key Trait) bool + func Ignore(err error, types ...*Type) error + func IgnoreWithTrait(err error, traits ...Trait) error + func IsDuplicate(err error) bool + func IsNotFound(err error) bool + func IsOfType(err error, t *Type) bool + func IsOfTypeIgnoreTransparent(err error, t *Type) bool + func IsTemporary(err error) bool + func IsTimeout(err error) bool + func Panic(err error) error + func RegisterTypeSubscriber(s TypeSubscriber) + func ReplicateError(err error, count int) []error + func WrapMany(errorType *Type, message string, errs ...error) error + type Error struct + func Cast(err error) *Error + func Decorate(err error, message string, args ...interface{}) *Error + func EnhanceStackTrace(err error, message string, args ...interface{}) *Error + func EnsureStackTrace(err error) *Error + func WithContext(err *Error, ctx context.Context) *Error + func WithPayload(err *Error, payload interface{}) *Error + func (e *Error) Cause() error + func (e *Error) Error() string + func (e *Error) Format(s fmt.State, verb rune) + func (e *Error) HasTrait(key Trait) bool + func (e *Error) Is(target error) bool + func (e *Error) IsOfType(t *Type) bool + func (e *Error) IsOfTypeIgnoreTransparent(t *Type) bool + func (e *Error) Message() string + func (e *Error) Property(key Property) (interface{}, bool) + func (e *Error) Type() *Type + func (e *Error) Unwrap() error + func (e *Error) WithProperty(key Property, value interface{}) *Error + func (e *Error) WithUnderlyingErrors(errs ...error) *Error + type ErrorBuilder struct + func NewErrorBuilder(t *Type) ErrorBuilder + func (eb ErrorBuilder) Create() *Error + func (eb ErrorBuilder) EnhanceStackTrace() ErrorBuilder + func (eb ErrorBuilder) Transparent() ErrorBuilder + func (eb ErrorBuilder) WithCause(err error) ErrorBuilder + func (eb ErrorBuilder) WithConditionallyFormattedMessage(message string, args ...interface{}) ErrorBuilder + type Namespace struct + func NewNamespace(name string, traits ...Trait) Namespace + func (n Namespace) ApplyModifiers(modifiers ...TypeModifier) Namespace + func (n Namespace) FullName() string + func (n Namespace) IsNamespaceOf(t *Type) bool + func (n Namespace) Key() NamespaceKey + func (n Namespace) NewSubNamespace(name string, traits ...Trait) Namespace + func (n Namespace) NewType(typeName string, traits ...Trait) *Type + func (n Namespace) Parent() *Namespace + func (n Namespace) String() string + type NamespaceKey struct + type Property struct + func PropertyContext() Property + func PropertyPayload() Property + func RegisterPrintableProperty(label string) Property + func RegisterProperty(label string) Property + type StackTraceFilePathTransformer func(string) string + func InitializeStackTraceTransformer(transformer StackTraceFilePathTransformer) (StackTraceFilePathTransformer, error) + type Trait struct + func CaseNoError() Trait + func CaseNoTrait() Trait + func Duplicate() Trait + func NotFound() Trait + func RegisterTrait(label string) Trait + func Temporary() Trait + func Timeout() Trait + func TraitSwitch(err error, traits ...Trait) Trait + type Type struct + func NewType(namespace Namespace, name string, traits ...Trait) *Type + func NotRecognisedType() *Type + func TypeSwitch(err error, types ...*Type) *Type + func (t *Type) ApplyModifiers(modifiers ...TypeModifier) *Type + func (t *Type) FullName() string + func (t *Type) HasTrait(key Trait) bool + func (t *Type) IsOfType(other *Type) bool + func (t *Type) MarshalText() (text []byte, err error) + func (t *Type) Namespace() Namespace + func (t *Type) New(message string, args ...interface{}) *Error + func (t *Type) NewSubtype(name string, traits ...Trait) *Type + func (t *Type) NewWithNoMessage() *Error + func (t *Type) RootNamespace() Namespace + func (t *Type) String() string + func (t *Type) Supertype() *Type + func (t *Type) Wrap(err error, message string, args ...interface{}) *Error + func (t *Type) WrapWithNoMessage(err error) *Error + type TypeModifier int + const TypeModifierOmitStackTrace + const TypeModifierTransparent + type TypeSubscriber interface + OnNamespaceCreated func(namespace Namespace) + OnTypeCreated func(t *Type)