errors

package module
v0.0.0-...-68b9210 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: BSD-3-Clause Imports: 1 Imported by: 10

README

Errors

This is an experiment in error handling. I wanted a base error type that is exported so that it can be initlized for const. I'm not interested in the call stack for error handling.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(cause string, err error) error

Wrap the cause of an error with the error

Types

type String

type String string

String creates an error from a string

func (String) Error

func (s String) Error() string

Error implements error interface

func (String) String

func (s String) String() string

String implements stringer interface

type Wrapper

type Wrapper struct {
	Err     error
	Because string
}

Wrapper wraps an error and a cause

func (*Wrapper) Cause

func (w *Wrapper) Cause() string

Cause returns the cause of the error

func (*Wrapper) Error

func (w *Wrapper) Error() string

Error implements error interface

Jump to

Keyboard shortcuts

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