errors

package
v1.66.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 1 Imported by: 9

Documentation

Overview

Package errors provides error handling utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(err error, f WalkFunc)

Walk invokes the given function for each error in the chain. If the provided functions returns true or no further cause can be found, the process is stopped and no further calls will be made.

The next error in the chain is determined by the following rules:

	the return value of this method is used.
  - If the current error has a `Unwrap() error` method
    the return value of this method is used.
  - If the current error has a `Unwrap() []error` method
    the return values of this method is used.
  - Common errors in the Go runtime that contain an Err field will use this value.

Types

type WalkFunc

type WalkFunc func(error) bool

WalkFunc is the signature of the Walk callback function. The function gets the current error in the chain and should return true if the chain processing should be aborted.

Jump to

Keyboard shortcuts

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