Documentation ¶
Index ¶
- func BuildNumber() int64
- func ErrorLoggingEnabled() bool
- func ExecWithoutErrorLogging(action NoErrorsLoggingAction)
- func Fatal(num int64, endUserMsg string, parentErr error)
- func NewOrNilFromParent(num int64, endUserMsg string, parentErr error) error
- func Version() string
- type DeepError
- type NoErrorsLoggingAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNumber ¶
func BuildNumber() int64
func ErrorLoggingEnabled ¶
func ErrorLoggingEnabled() bool
enable/disable automatic logging of deeperrors upon creation
func ExecWithoutErrorLogging ¶
func ExecWithoutErrorLogging(action NoErrorsLoggingAction)
you can use this method to temporarily disable automatic logging of deeperrors
func NewOrNilFromParent ¶
Convenience method. This will return nil if parrentErr == nil. Otherwise it will create a DeepError and return that.
Types ¶
type DeepError ¶
type DeepError struct { Num int64 Filename string CallingMethod string Line int EndUserMsg string DebugMsg string DebugFields map[string]interface{} Err error // inner or source error StatusCode int StackTrace string }
func New ¶
Primary Constructor. Create a DeepError ptr with the given number, end user message and optional parent error.
func NewHTTPError ¶
HTTP variant. Create a DeepError with the given http status code
func NewTODOError ¶
Convenience method. creates a simple DeepError with the given error number. The error message is set to "TODO"
func (*DeepError) AddDebugField ¶
Add arbitrary debugging data to a given DeepError
func (*DeepError) Error ¶
Conform to the go built-in error interface http://golang.org/pkg/builtin/#error
func (*DeepError) StatusCodeIsDefaultValue ¶
Check if the current status code matches the global default
func (*DeepError) Unwrap ¶ added in v1.3.0
cConform to the new Unwrap interface. Unwrap() will expose errors further down the error chain This should allow support for Is() and As() in Go 1.13 and later Alternatively, earlier version of Go can import "golang.org/x/xerrors" to get library support for Is(), As(), and Unwrap() see https://blog.golang.org/go1.13-errors for details
type NoErrorsLoggingAction ¶
type NoErrorsLoggingAction func()
anything performed in this anonymous function will not trigger automatic logging of deeperrors upon creation