errs

package
v0.0.0-...-9012c6e Latest Latest
Warning

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

Go to latest
Published: May 22, 2012 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Errors and error utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsPanic

func AsPanic(args ...interface{})

Panic if any of the args is a non nil error

func Assert

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

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 LastAsPanic

func LastAsPanic(args ...interface{})

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

func PanicIfIndexOutOfBounds

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

Types

type Configuration

type Configuration struct {
	FormatWithCallStack bool
}
var Config Configuration = Configuration{
	FormatWithCallStack: true,
}

type IndexOutOfBounds

type IndexOutOfBounds struct {
	What   string
	Index  int
	Length int
}

func IfIndexOutOfBounds

func IfIndexOutOfBounds(what string, index int, length int) *IndexOutOfBounds

func (*IndexOutOfBounds) Error

func (self *IndexOutOfBounds) Error() string

type NotImplemented

type NotImplemented string

func (NotImplemented) Error

func (self NotImplemented) Error() string

Jump to

Keyboard shortcuts

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