Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catcher ¶
type Catcher struct {
// contains filtered or unexported fields
}
Catcher handles safely catching the panic. Use `Try` instead of this class direction.
func (*Catcher) Caught ¶
func (p *Catcher) Caught() *RecoveredPanic
type RecoveredPanic ¶
type RecoveredPanic struct { Value any DebugTrace []byte // contains filtered or unexported fields }
func Try ¶
func Try(fn func()) *RecoveredPanic
Try calls the given function and recovers from any panic. If a panic is not raised, the returned value will be nil.
func (*RecoveredPanic) Error ¶
func (p *RecoveredPanic) Error() error
Error returns a RecoveredPanicError It is safe to call this on a nil value and the result will be nil.
func (*RecoveredPanic) String ¶
func (p *RecoveredPanic) String() string
type RecoveredPanicError ¶
type RecoveredPanicError struct {
RecoveredPanic
}
func AsRecoveredPanicError ¶
func AsRecoveredPanicError(err error) *RecoveredPanicError
func (*RecoveredPanicError) Error ¶
func (p *RecoveredPanicError) Error() string
func (*RecoveredPanicError) StackTrace ¶
func (p *RecoveredPanicError) StackTrace() pkgErr.StackTrace
func (*RecoveredPanicError) Unwrap ¶
func (p *RecoveredPanicError) Unwrap() error
type StackTraceProvider ¶
type StackTraceProvider interface {
StackTrace() pkgErr.StackTrace
}
Click to show internal directories.
Click to hide internal directories.