errverbose

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: 7 Imported by: 2

Documentation

Overview

Package errverbose provides utilities to manage error verbose messages.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Formatter

func Formatter(err error) fmt.Formatter

Formatter returns a fmt.Formatter that writes the error's verbose message.

Example
err := errbase.New("error")
f := Formatter(err)
fmt.Println(f)
Output:

error

func String

func String(err error) string

String returns the error's verbose message as a string.

Example
err := errbase.New("error")
s := String(err)
fmt.Println(s)
Output:

error

func Write

func Write(w io.Writer, err error)

Write writes the error's verbose message to the writer.

The first line is the error's message. The following lines are the verbose message of the error chain.

Example
err := errbase.New("error")
buf := new(strings.Builder)
Write(buf, err)
s := buf.String()
fmt.Println(s)
Output:

error

Types

type Interface

type Interface interface {
	// ErrorVerbose writes the error verbose message.
	// It must only write the verbose message of the error, not the error chain.
	ErrorVerbose(w io.Writer)
}

Interface is an error that provides verbose information.

It is used by Write.

Jump to

Keyboard shortcuts

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