Documentation
¶
Overview ¶
Package recovery turns a panic in a request handler into an error for that request instead of a crashed process: gRPC and ws-proto calls get codes.Internal, HTTP requests 500. Every recovered panic is logged as an OpenTelemetry exception record (with its stack and the request's trace) and counted in backplane.panics{where}.
Index ¶
Constants ¶
const ( GRPCPublic = "grpc.public" GRPCInternal = "grpc.internal" WSProto = "wsproto" HTTPPublic = "http.public" HTTPPlatform = "http.platform" )
Where a panic was recovered: the value of the metric's where attribute.
Variables ¶
This section is empty.
Functions ¶
func HTTP ¶
HTTP recovers a panicking handler: the client gets 500 when nothing was written yet. http.ErrAbortHandler keeps its meaning (abort the response silently) and is re-raised for net/http.
func ServerOptions ¶
func ServerOptions(log *xlog.Logger, where string) []grpc.ServerOption
ServerOptions installs Unary and Stream first in the server's chain, so they also cover the interceptors that follow.
Types ¶
This section is empty.