mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
17 lines
234 B
Go
17 lines
234 B
Go
package otlp
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
func RecordErrorOnRecover(ctx context.Context, forwardPanic bool) func() {
|
|
return func() {
|
|
if e := recover(); e != nil {
|
|
RecordAsError(ctx, e)
|
|
if forwardPanic {
|
|
panic(e)
|
|
}
|
|
}
|
|
}
|
|
}
|