MCPcopy Create free account
hub / github.com/chain/txvm / RecoverAndLogError

Function RecoverAndLogError

log/log.go:235–247  ·  view source on GitHub ↗

RecoverAndLogError must be used inside a defer.

(ctx context.Context)

Source from the content-addressed store, hash-verified

233
234// RecoverAndLogError must be used inside a defer.
235func RecoverAndLogError(ctx context.Context) {
236 Helper()
237 if err := recover(); err != nil {
238 const size = 64 << 10
239 buf := make([]byte, size)
240 buf = buf[:runtime.Stack(buf, false)]
241 Printkv(ctx,
242 KeyMessage, "panic",
243 KeyError, err,
244 KeyStack, buf,
245 )
246 }
247}

Callers

nothing calls this directly

Calls 2

HelperFunction · 0.85
PrintkvFunction · 0.85

Tested by

no test coverage detected