errors

package
v0.80.0-devel Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package errors contains errors used by the installer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(err error) string

ToJSON returns the error as a JSON string.

func WithStack

func WithStack(err error) error

WithStack wraps an error with a stack trace captured at the call site. Returns nil if err is nil. Returns err unchanged if it already carries a stack trace.

func Wrap

func Wrap(errCode InstallerErrorCode, err error) error

Wrap wraps the given error with an installer error. If the given error is already an installer error, it is not wrapped and left as it is. Only the deepest InstallerError remains.

Types

type InstallerError

type InstallerError struct {
	// contains filtered or unexported fields
}

InstallerError is an error type used by the installer.

func FromJSON

func FromJSON(errStr string) *InstallerError

FromJSON returns an InstallerError from a JSON string.

func (InstallerError) Error

func (e InstallerError) Error() string

Error returns the error message.

func (InstallerError) Is

func (e InstallerError) Is(target error) bool

Is implements the Is method of the errors.Is interface.

func (*InstallerError) StackTrace

func (e *InstallerError) StackTrace() []uintptr

StackTrace returns the stack trace captured at the point where the error was wrapped.

func (*InstallerError) Unwrap

func (e *InstallerError) Unwrap() error

Unwrap returns the underlying error.

type InstallerErrorCode

type InstallerErrorCode uint64

InstallerErrorCode is an error code used by the installer.

const (

	// ErrDownloadFailed is the code for a download failure.
	ErrDownloadFailed InstallerErrorCode = 1
	// ErrNotEnoughDiskSpace is the code for not enough disk space.
	ErrNotEnoughDiskSpace InstallerErrorCode = 2
	// ErrPackageNotFound is the code for a package not found.
	ErrPackageNotFound InstallerErrorCode = 3
	// ErrFilesystemIssue is the code for a filesystem issue (e.g. permission issue).
	ErrFilesystemIssue InstallerErrorCode = 4
	// ErrConfigNotFound is the code for a config not found.
	ErrConfigNotFound InstallerErrorCode = 5
	// ErrPasswordNotProvided is the code for a password not provided.
	ErrPasswordNotProvided InstallerErrorCode = 6
)

func GetCode

func GetCode(err error) InstallerErrorCode

GetCode returns the installer error code of the given error.

Jump to

Keyboard shortcuts

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