errs

package
v0.0.0-...-8bfda83 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: MIT Imports: 3 Imported by: 61

Documentation

Overview

Errors and error utility functions.

Index

Constants

This section is empty.

Variables

View Source
var Config = Configuration{
	FormatWithCallStack: true,
}

Functions

func Assert

func Assert(condition bool, description string, args ...interface{})

func Errors

func Errors(errs ...error) error

func First

func First(args ...interface{}) error

Returns the first error in args

func Format

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

Format formats an error with call stack information if FormatWithCallStack is true

func FormatSkipStackFrames

func FormatSkipStackFrames(skip int, format string, args ...interface{}) error

FormatSkipStackFrames formats an error with call stack information if FormatWithCallStack is true. It skips skip stack frames.

func LastPanicOnError

func LastPanicOnError(args ...interface{})

Panic if the last element of args is a non nil error

func PanicIfErrIndexOutOfBounds

func PanicIfErrIndexOutOfBounds(what string, index int, length int)

func PanicOnError

func PanicOnError(args ...interface{})

Panic if any of the args is a non nil error

Types

type Configuration

type Configuration struct {
	FormatWithCallStack bool
}

type ErrIndexOutOfBounds

type ErrIndexOutOfBounds struct {
	What   string
	Index  int
	Length int
}

func IfErrIndexOutOfBounds

func IfErrIndexOutOfBounds(what string, index int, length int) *ErrIndexOutOfBounds

func (*ErrIndexOutOfBounds) Error

func (self *ErrIndexOutOfBounds) Error() string

type ErrNotImplemented

type ErrNotImplemented string

func (ErrNotImplemented) Error

func (self ErrNotImplemented) Error() string

type ErrSlice

type ErrSlice []error

ErrSlice implements error for a slice of errors. Error() returns the Error() results for every slice field concaternated by '\n'. nil errors are ignored.

func (ErrSlice) Error

func (self ErrSlice) Error() string

func (ErrSlice) Join

func (self ErrSlice) Join(sep string) string

Jump to

Keyboard shortcuts

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