Documentation
¶
Overview ¶
Package oppanic converts a recovered operation panic into the one coded error every recover site returns: PROCESSING_PANIC with details op, panic_type and stack. The facade's recover (observability.go) and the engine's worker-pool recovers (internal/service) both build their error here, so there is one code and one detail shape everywhere.
The panic VALUE is never kept: it can carry row data, so neither the message nor details nor a wrapped cause holds it. Only its Go type name and the stack (function plus file:line per frame) survive.
Index ¶
Constants ¶
const MaxFrames = 32
MaxFrames caps details.stack.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(op string, recovered any) *errors.CodedError
Error builds the PROCESSING_PANIC error for a panic recovered while running operation op (an observe.OperationKind spelling, e.g. "process"). recovered is the value recover() returned; only its type name is kept.
Call it from the deferred function that called recover(), so the stack still holds the panicking frames: the stack starts at the frame that panicked (runtime panic helpers skipped). Called outside a panic it starts at its caller.
Types ¶
This section is empty.