Documentation ¶
Overview ¶
Package d implements several debug, error and assertion functions used throughout Noms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
Chk = assert.New(&panicker{})
)
d.Chk.<Method>() -- used in test cases and as assertions
Functions ¶
func Panic ¶
func Panic(format string, args ...interface{})
Panic(err) creates an error using format and args and wraps it in a WrappedError which can be handled using Try() and TryCatch()
func PanicIfError ¶
func PanicIfError(err error)
PanicIfError(err) && PanicIfTrue(expr) can be used to panic in a way that's easily handled by Try() and TryCatch()
func PanicIfFalse ¶
func PanicIfFalse(b bool)
If b is false, creates a default error, wraps it and panics.
func PanicIfNotType ¶
Utility method, that checks type of error and panics with wrapped error not one of the listed types.
func PanicIfTrue ¶
func PanicIfTrue(b bool)
If b is true, creates a default error, wraps it and panics.
Types ¶
type WrappedError ¶
func Wrap ¶
func Wrap(err error) WrappedError
Wraps an error. The enclosing error has a default Error() that contains the error msg along with a backtrace. The original error can be retrieved by calling err.Cause().