From 28b44e57d75dcd8a267472f60ccf5fe2abc423f2 Mon Sep 17 00:00:00 2001 From: Elie Date: Wed, 6 Jan 2021 09:56:42 +0100 Subject: [PATCH] Capture panic in // runner and fwd to sentry --- pkg/parallel_runner.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/parallel_runner.go b/pkg/parallel_runner.go index 81930f8e4..bd6ab6f78 100644 --- a/pkg/parallel_runner.go +++ b/pkg/parallel_runner.go @@ -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)) } }()