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: 3 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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