errutils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIgnorableErr

func IsIgnorableErr(err error) bool

IsIgnorableErr returns true if the provided error is: - an EPIPE error - a connection reset (ECONNRESET) error - an http2 GOAWAY error - an http2 stream internal error - a DNS cancellation - a network timeout - an unexpected EOF - or a normal EOF IMPORTANT: When adding conditions to this function, make sure all of the checks are in the if and not in the return. This way, it'll try all of the possible conditions. Otherwise, you might get a case where it passes the checks in the if statement, but then fails inside of the if block, but it would've passed in a later condition.

func Unwrap

func Unwrap(err error) error

Unwrap takes in an error, goes through the error cause chain, and returns the deepest error that has a stacktrace. This is needed because by default, every subsequent call to errors.Wrap overwrites the previous stacktrace. So in the end, we don't know where the error originated from. By going to the deepest one, we can find exactly where it started.

Types

This section is empty.

Jump to

Keyboard shortcuts

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