errors

package
v2.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: MIT Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must(result ...interface{}) interface{}

Must traps errors and return the remaining results to the caller If there is an error, a panic is issued

func Print

func Print(err error)

Print print error to the stderr in red

func Printf

func Printf(format string, args ...interface{})

Printf print a message to the stderr in red

func Raise

func Raise(format string, args ...interface{})

Raise issues a panic with a formated message representing a managed error

func Trap

func Trap(sourceErr error, recovered interface{}) (err error)

Trap catch any panic exception, and convert it to error It must be called with current error state and recover() as argument

Types

type Array

type Array []error

Array represent an array of error

func (Array) Error

func (errors Array) Error() string

type Managed

type Managed string

Managed indicates an error that is properly handled (no need to print out stack)

func (Managed) Error

func (err Managed) Error() string

type TemplateNotFoundError

type TemplateNotFoundError struct {
	// contains filtered or unexported fields
}

TemplateNotFoundError is returned when a template does not exist

func (TemplateNotFoundError) Error

func (e TemplateNotFoundError) Error() string

Jump to

Keyboard shortcuts

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