errors

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides custom error types for the disa application.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDockerNotRunning  = New("docker daemon is not running")
	ErrImageNotFound     = New("image not found")
	ErrInvalidImageRef   = New("invalid image reference")
	ErrAnalysisFailed    = New("analysis failed")
	ErrUnsupportedFormat = New("unsupported output format")
)

Common errors.

Functions

func As

func As(err error, target interface{}) bool

As finds the first error in err's tree that matches target.

func Is

func Is(err, target error) bool

Is reports whether any error in err's tree matches target.

func New

func New(message string) error

New creates a new error with the given message.

func Wrap

func Wrap(err error, op string) error

Wrap wraps an error with context.

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf wraps an error with a formatted message.

Types

type DisaError

type DisaError struct {
	Op   string // operation being performed
	Err  error  // underlying error
	Kind ErrorKind
}

DisaError is the base error type for the application.

func (*DisaError) Error

func (e *DisaError) Error() string

func (*DisaError) Unwrap

func (e *DisaError) Unwrap() error

type ErrorKind

type ErrorKind int

ErrorKind represents the category of error.

const (
	// KindUnknown represents an unknown error type.
	KindUnknown ErrorKind = iota
	// KindDocker represents a Docker-related error.
	KindDocker
	// KindParse represents a parsing error.
	KindParse
	// KindValidation represents a validation error.
	KindValidation
	// KindNotFound represents a "not found" error.
	KindNotFound
	// KindUnauthorized represents an authentication error.
	KindUnauthorized
)

Jump to

Keyboard shortcuts

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