Skip to content

Commit

Permalink
Capture panic in // runner and fwd to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
Elie committed Jan 6, 2021
1 parent c564ba0 commit 28b44e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/parallel_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"sync"

"github.com/getsentry/sentry-go"
"github.com/sirupsen/logrus"

"go.uber.org/atomic"
Expand Down Expand Up @@ -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))
}
}()
Expand Down

0 comments on commit 28b44e5

Please sign in to comment.