Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Throw ¶
func Throw(ex exception, message string)
Throw Format and throw error message with type and message
func Try ¶
func Try(function tryFn) (err exception)
Try catch all errors and exceptions and return them without failing
func TryCatch ¶
func TryCatch(function tryFn, catchers ...*CatcherWrapper) (err exception)
TryCatch catch errors specified in catchers, if an *m3lsh.BaseException is given it takes any kind of exception, otherwise, exception Type must exactly match given type
Types ¶
type BaseException ¶
type BaseException struct {
Message string
// contains filtered or unexported fields
}
BaseException parent of all exceptions, implements some basic methods and acts as a catch-all exception type
func (BaseException) Stacktrace ¶
func (b BaseException) Stacktrace() []string
Stacktrace get printable stack trace lines
type CatcherWrapper ¶
type CatcherWrapper struct {
// contains filtered or unexported fields
}
CatcherWrapper a wrapper for an exception catch function
func Catcher ¶
func Catcher(typ exception, fn catchFn) *CatcherWrapper
Catcher generate CatcherWrapper for a specific exception type with a handler
Click to show internal directories.
Click to hide internal directories.