Selaa lähdekoodia

flush to sentry from CLI errors (#2818)

Mohammed Nafees 3 vuotta sitten
vanhempi
sitoutus
c5fa90a992
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      cli/cmd/errors/error_handler.go

+ 3 - 3
cli/cmd/errors/error_handler.go

@@ -3,6 +3,7 @@ package errors
 import (
 	"fmt"
 	"os"
+	"time"
 
 	"github.com/fatih/color"
 	"github.com/getsentry/sentry-go"
@@ -35,9 +36,8 @@ func (h *sentryErrorHandler) HandleError(err error) {
 			})
 		})
 
-		if eventID := localHub.CaptureException(err); eventID == nil {
-			color.New(color.FgRed).Fprintf(os.Stderr, "error in sending exception to sentry\n")
-		}
+		localHub.CaptureException(err)
+		sentry.Flush(2 * time.Second)
 	}
 
 	color.New(color.FgRed).Fprintf(os.Stderr, "error: %s\n", err.Error())