erres

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHumanError

type BaseHumanError struct {
	Message string
	Err     error
}

BaseHumanError is the most basic version of HumanError, and simply embeds a static human error message inside it.

func NewHumanError

func NewHumanError(message string, err error) *BaseHumanError

NewHumanError wraps err with a human-readable message.

func (*BaseHumanError) Error

func (e *BaseHumanError) Error() string

Error returns the underlying error message.

func (*BaseHumanError) HumanError

func (e *BaseHumanError) HumanError() string

HumanError returns the human-readable message.

type HumanError

type HumanError interface {
	error
	HumanError() string
}

HumanError is an extension of the built-in error that also bundles a more human-readable variant of the message. I.e. where the normal error might say "failed to open file ...: $error message", HumanError would contain something more helpful like "failed while trying to read your configuration file. Make sure it exists and has correct permissions."

Jump to

Keyboard shortcuts

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