errors

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package errors defines error types and exit codes for the application.

Index

Constants

View Source
const (
	ExitSuccess     = 0
	ExitRuntime     = 1
	ExitConfig      = 2
	ExitEnvironment = 3
	ExitUserAbort   = 4
)

Exit codes

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Message  string
	ExitCode int
	Cause    error
}

AppError represents an application error with an exit code.

func Config

func Config(msg string) *AppError

Config creates a configuration error (exit code 2).

func Environment

func Environment(msg string, cause error) *AppError

Environment creates an environment error (exit code 3).

func Runtime

func Runtime(msg string, cause error) *AppError

Runtime creates a runtime error (exit code 1).

func UserAbort

func UserAbort() *AppError

UserAbort creates a user abort error (exit code 4).

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

Jump to

Keyboard shortcuts

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