errors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package errors providers utilities for manipulate errors and provide stack trace information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(err1 error, err2 error) bool

Equal detects whether the error is equal to a given error. Errors are considered equal by this function if they are the same object, or if they both contain the same error inside.

func New

func New(message string) error

New returns a new Error. It's used to instead of built-in errors.New function.

func Newf

func Newf(format string, args ...interface{}) error

Newf same as New, but with fmt.Printf-style parameters.

func TreeMessage

func TreeMessage(err error) string

TreeMessage returns the errors message in a tree like format: ├─ error message -> filename:line | ├─ error message -> filename:line | └─ error 3

func Wrap

func Wrap(err error, message string) error

Wrap returns a new wrapped Error.

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf same as Wrap, but with fmt.Printf-style parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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