errs

package
v0.0.0-...-88133c6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(err *error, errF func() error, msg string)

Capture runs errF and assigns the error, if any, to *err. Preserves the original err by wrapping in a MultiError if err is non-nil. If msg is not empty, wrap the error returned by closer with the msg.

  • If errF returns nil, do nothing.
  • If errF returns an error and *err == nil, replace *err with the error.
  • If errF returns an error and *err != nil, replace *err with a MultiError containing *err and the errF err.

func CaptureT

func CaptureT(t *testing.T, errF func() error, msg string)

CaptureT call t.Error if errF returns an error with an optional message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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