Help us shape the future of Go! Take the 2026 Go Developer Survey

oppanic

package
v1.0.0-alpha.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 6 Imported by: 0

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL