Capture panic in // runner and fwd to sentry
parent
c564ba001f
commit
28b44e57d7
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"go.uber.org/atomic"
|
||||
|
@ -89,6 +90,7 @@ func (p *ParallelRunner) Run(runnable func() (interface{}, error)) {
|
|||
// Some failed call to grpc plugin like getSchema trigger a panic
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
sentry.CurrentHub().Recover(r)
|
||||
p.Stop(fmt.Errorf("A runner routine paniced: %s", r))
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue