hint

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(err error, firstHint string, extraHints ...string) error

Wrap wraps up an error with hints, to help display hints to a user about what might fix the problem.

func Wrapf

func Wrapf(err error, hintf string, args ...any) error

Wrapf wraps an error with a single hint with formatting arguments.

Types

type Error

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

Error is an error that includes hints to be displayed after the error.

func FromError

func FromError(err error) (*Error, bool)

FromError attempts to parse the given error's string to an *hint.Error

func (*Error) Error

func (e *Error) Error() string

Error returns the error string

func (*Error) Hint

func (e *Error) Hint() string

Hint returns all hints in a single string separated by a new line

func (*Error) Message

func (e *Error) Message() string

Jump to

Keyboard shortcuts

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