errors

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyCommitted is returned when attempting to commit or rollback an already committed transaction
	ErrAlreadyCommitted = errors.New("transaction already committed")

	// ErrAlreadyRolledBack is returned when attempting to commit or rollback an already rolled back transaction
	ErrAlreadyRolledBack = errors.New("transaction already rolled back")

	// ErrHookFailed is returned when a critical hook fails
	ErrHookFailed = errors.New("critical hook failed")

	// ErrInvalidSavepoint is returned when a savepoint is invalid or belongs to a different transaction
	ErrInvalidSavepoint = errors.New("invalid savepoint")
)

Functions

This section is empty.

Types

type HookError

type HookError struct {
	HookType string
	Err      error
	Critical bool
}

HookError wraps an error that occurred during hook execution

func (*HookError) Error

func (e *HookError) Error() string

func (*HookError) Is

func (e *HookError) Is(target error) bool

Is implements error matching for HookError This allows errors.Is(err, ErrHookFailed) to work for critical hook errors

func (*HookError) Unwrap

func (e *HookError) Unwrap() error

Unwrap returns the underlying error

type OperationError

type OperationError struct {
	Operation string
	Err       error
}

OperationError wraps an error that occurred during operation execution

func (*OperationError) Error

func (e *OperationError) Error() string

func (*OperationError) Unwrap

func (e *OperationError) Unwrap() error

type PanicError

type PanicError struct {
	Value interface{}
	Stack string
}

PanicError wraps a recovered panic

func (*PanicError) Error

func (e *PanicError) Error() string

type RollbackError

type RollbackError struct {
	Errors []error
}

RollbackError wraps errors that occurred during rollback

func (*RollbackError) Error

func (e *RollbackError) Error() string

func (*RollbackError) Unwrap

func (e *RollbackError) Unwrap() []error

Unwrap returns the list of errors for Go 1.20+ multi-error support This enables errors.Is() and errors.As() to work with all wrapped errors

Jump to

Keyboard shortcuts

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