errutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CouldntReadError

func CouldntReadError(path string, err error)

CouldntReadError logs.Fatal an error related to reading a file

func CouldntWriteError

func CouldntWriteError(path string, err error)

CouldntWriteError logs.Fatal an error relating to writing a file

func ExecError

func ExecError(cmd *exec.Cmd, out string, err error)

ExecError logs.Fatal with a useful message for errors that occur when using os/exec to run commands

func GenericError

func GenericError(msg string, specified interface{}, actual interface{}) (int, string, error)

GenericError is a general error where the requested variable was not found in a given list of variables. This is pure DRY.

func IndexError

func IndexError(msg string, i int, slc interface{})

IndexError logs a message about an attempt to access an array element outside the range of a given list

func PathError

func PathError(path string, err error, action string)

FileError is an abstraction of CouldntReadError and CouldntWriteError

func ReflectError

func ReflectError(value interface{}, expectedKind reflect.Kind, funcName string)

ReflectError logs a message about a failure of types during reflection

func Success

func Success() (int, string, error)

Success is what a check should return if it is successful

Types

type ParameterLengthError

type ParameterLengthError struct {
	Expected int
	Params   []string
}

ParameterLengthError is the type of error a Check raises when it recieves the incorrect number of parameters.

func (ParameterLengthError) Error

func (e ParameterLengthError) Error() string

type ParameterTypeError

type ParameterTypeError struct{ Parameter, Expected string }

ParameterTypeError is the type of error a Check returns when it can't parse its parameters as their expected types.

func (ParameterTypeError) Error

func (e ParameterTypeError) Error() string

Jump to

Keyboard shortcuts

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