Documentation ¶
Overview ¶
Package errhand contains error handling functionality that is designed to be formatted and displayed to the user on the command line
The VerboseError interface extends error and provides a method Verbose which should give a more verbose message about an error, and it's cause.
DError is a displayable error which implements the VerboseError interface. It is formatted to be able to provide clear and concise error messaging back to the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrVerboseEmpty = emptyErr{}
Functions ¶
This section is empty.
Types ¶
type DError ¶
type DError struct {
// contains filtered or unexported fields
}
func (*DError) ShouldPrintUsage ¶
type DErrorBuilder ¶
type DErrorBuilder struct {
// contains filtered or unexported fields
}
func BuildDError ¶
func BuildDError(dispFmt string, args ...interface{}) *DErrorBuilder
func BuildIf ¶
func BuildIf(err error, dispFmt string, args ...interface{}) *DErrorBuilder
func (*DErrorBuilder) AddCause ¶
func (builder *DErrorBuilder) AddCause(cause error) *DErrorBuilder
func (*DErrorBuilder) AddDetails ¶
func (builder *DErrorBuilder) AddDetails(detailsFmt string, args ...interface{}) *DErrorBuilder
func (*DErrorBuilder) Build ¶
func (builder *DErrorBuilder) Build() VerboseError
func (*DErrorBuilder) SetPrintUsage ¶
func (builder *DErrorBuilder) SetPrintUsage() *DErrorBuilder
type VerboseError ¶
func PanicToVError ¶
func PanicToVError(errMsg string, f func() VerboseError) VerboseError
func VerboseErrorFromError ¶
func VerboseErrorFromError(err error) VerboseError
Returns a verbose error using the error given. If the error given is already a VerboseError, returns it. Otherwise, creates a new VerboseError with the given error's error string.
Click to show internal directories.
Click to hide internal directories.