Documentation
¶
Overview ¶
Package safe turns panics into ordinary errors so a bug in one unit of work (a page, a plugin hook, an embedded-JS evaluation) is reported as a normal diagnostic instead of crashing the whole compiler. Set KRATE_DEBUG=1 to let panics propagate with their original stack for debugging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Guard ¶
func Guard(fn func(), onPanic func(error))
Guard runs fn and recovers any panic, reporting it to onPanic (which may be nil). Intended for fire-and-forget goroutines whose return value is discarded.
Types ¶
type PanicError ¶
PanicError wraps a recovered panic value together with the stack at the point it was recovered.
func (*PanicError) Error ¶
func (e *PanicError) Error() string
Click to show internal directories.
Click to hide internal directories.