errtmp

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package errtmp provides a way to mark errors as temporary.

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

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(err error) bool

Is returns true if an error is temporary, false otherwise.

By default, an error is considered temporary. This is the opposite of the usual convention where an error that does not implement a Temporary() bool method is considered not temporary. To explicitly mark an error as not temporary, wrap it with Wrap and the value false.

func Wrap

func Wrap(err error, tmp bool) error

Wrap marks an error as temporary.

The verbose message is "temporary = <tmp>".

Types

This section is empty.

Jump to

Keyboard shortcuts

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