terrors

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contexture

type Contexture interface {
	// Context gets a copy of the context for this object.
	Context() map[string]any
}

Contexture is an object, typically an error, which contains contextual information.

type Messager

type Messager interface {
	// Message gets the raw message for this object.
	Message() string
}

Messager is an object, typically an error, which contains a message. For errors this message is the raw (constant) string message for the error with is used in the more detailed `Error() string`.

type MonoWrap

type MonoWrap interface {
	// Unwrap unwraps the single error.
	Unwrap() error
}

MonoWrap is an error which wraps a single error.

type MultiWrap

type MultiWrap interface {
	// Unwraps all of the internal errors.
	Unwrap() []error
}

MultiWrap is an error which wraps a single error.

type Stacked

type Stacked interface {
	// Gets the stack trace for where this object was created.
	Stack() string
}

Stacked is an object, typically an error, which contains a stack trace for where this object was created.

type TError

type TError interface {
	error
	Stacked
	Contexture
	MultiWrap
	Messager

	// Equals returns true if this error and the given error are equal.
	//
	// This will not compare stacks.
	Equals(other any) bool

	// String gets a detailed string for this error.
	String() string

	// With adds more context to this error.
	// Returns the receiver for method chaining.
	With(key string, value any) TError

	// Withf adds more formatted context to this error.
	// Returns the receiver for method chaining.
	Withf(key, format string, values ...any) TError

	// WithType adds more type context to this error.
	// Returns the receiver for method chaining.
	WithType(key string, value any) TError

	// WithError adds another wrapped error to this error.
	// Returns the receiver for method chaining.
	WithError(err error) TError

	// Resets the stack trace for the error.
	// Offset is the number of frames to leave off of the top of the stack.
	// Returns the receiver for method chaining.
	ResetStack(offset int) TError

	// Clone creates a copy of this error.
	Clone() TError
}

Error is an error object for the toolbox.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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