vizerror

package
v1.64.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 2 Imported by: 4

Documentation

Overview

Package vizerror provides types and utility funcs for handling visible errors that are safe to display to end users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

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

Errorf returns an Error with the specified format and values. It always returns a vizerror.Error.

func New

func New(text string) error

New returns an error that formats as the given text. It always returns a vizerror.Error.

func Wrap

func Wrap(err error) error

Wrap wraps err with a vizerror.Error.

Types

type Error

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

Error is an error that is safe to display to end users.

func As

func As(err error) (e Error, ok bool)

As returns the first vizerror.Error in err's chain.

func (Error) Error

func (e Error) Error() string

Error implements the error interface.

func (Error) Unwrap

func (e Error) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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