Documentation
¶
Overview ¶
Package panicrecovery converts panics on kernel request paths into ordinary errors so one faulty handler cannot terminate the kernel process.
Index ¶
Constants ¶
const MaxStackBytes = 16 << 10
MaxStackBytes bounds the stack trace written for one recovered panic.
Variables ¶
This section is empty.
Functions ¶
func InternalError ¶
func InternalError() error
InternalError is the status returned to a gRPC caller after a recovered panic. It deliberately carries no panic value or stack.
func ServerOptions ¶
func ServerOptions() []grpc.ServerOption
ServerOptions installs only the recovery interceptors. Servers that chain other interceptors should place UnaryServerInterceptor and StreamServerInterceptor first in their chains instead.
func Stack ¶
func Stack() string
Stack returns the calling goroutine's stack trace, truncated to MaxStackBytes.
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
StreamServerInterceptor is the streaming counterpart of UnaryServerInterceptor.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor recovers a panic raised by the unary handler or by any interceptor chained after it, logs it with a bounded stack trace, and returns codes.Internal.
Types ¶
This section is empty.