errmsg

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package errmsg provides a way to add messages to errors.

Example
err := errbase.New("error")
err = Wrap(err, "message")
fmt.Println(err)
Output:

message: error

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(err error, msg string) error

Wrap adds a message to an error.

The error message is "<msg>: <err>".

If the given message is empty, the returned error is the given error.

func Wrapf

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

Wrapf calls Wrap with a formatted message.

It doesn't support the %w verb.

Types

This section is empty.

Jump to

Keyboard shortcuts

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