vizerror
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package vizerror provides types and utility funcs for handling visible errorsthat are safe to display to end users.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcErrorf¶
Errorf returns an Error with the specified publicMsgFormat and values. It always returns a vizerror.Error.
Warning: avoid using an error as one of the format arguments, as this will cause the textof that error to be displayed to the end user (which is probably not what you want).
funcWrapdeprecated
Wrap wraps publicErr with a vizerror.Error.
Deprecated: this is almost always the wrong thing to do. Are you really sureyou know exactly what err.Error() will stringify to and be safe to show tousers?WrapWithMessage is probably what you want.
funcWrapWithMessage¶added inv1.76.0
WrapWithMessage wraps the given error with a message that's safe to displayto end users. The text of the wrapped error will not be displayed to endusers.
WrapWithMessage should almost always be preferred toWrap.
Types¶
typeError¶
type Error struct {// contains filtered or unexported fields}Error is an error that is safe to display to end users.
func (Error)Error¶
Error implements the error interface. The returned string is safe to displayto end users.
func (Error)Unwrap¶
Unwrap returns the underlying error.
If the Error was constructed usingWrapWithMessage, this is the wrapped (internal) errorand not the user-visible error message.