errs

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package errs contains user-facing error wrappers and helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserErrorf

func UserErrorf(format string, a ...any) error

UserErrorf is a user-facing error. This helper exists mostly to avoid linters complaining about errors starting with a capitalized letter.

Types

type Error

type Error struct {
	Err    error
	Reason string
}

Error wraps an underlying error with a user-facing reason.

Reason is meant to be short and actionable; Err may contain technical details. When Err is nil, Error() falls back to Reason.

func Wrap added in v0.2.3

func Wrap(err error, reason string) Error

Wrap creates an Error with the given underlying error and user-facing reason.

func Wrapf added in v0.2.3

func Wrapf(err error, format string, a ...any) Error

Wrapf creates an Error with the given underlying error and a formatted reason.

func (Error) Error

func (e Error) Error() string

func (Error) ReasonText

func (e Error) ReasonText() string

ReasonText returns the user-facing reason for the error.

func (Error) Unwrap

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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