errs

package
v0.0.0-...-c117620 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: GPL-3.0 Imports: 1 Imported by: 4

README

errs Package

This is just a few utility functions to make handling errors in Go a little easier.

Documentation

Overview

The errs package has a few utility functions to make handling errors a little more concise in certain cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(desc string, e ...error) error

Combine returns the composite of all non-nil errors in the input, with the given text description added for context.

func First

func First(desc string, e ...error) error

First returns the first non-nil error given in the input, wrapped with the given description string. If there isn't one, First returns nil.

func RootCause

func RootCause(e error) error

RootCause gets the ultimate root cause error out of a wrapped error. If the given error is not a wrapped error, the input is returned as-is.

func Wrap

func Wrap(desc string, e error) error

Wrap simply wraps an existing error with some context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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