2
0
Mohammed Nafees 3 жил өмнө
parent
commit
cf8a4eb42e
2 өөрчлөгдсөн 6 нэмэгдсэн , 4 устгасан
  1. 3 1
      cli/cmd/errors.go
  2. 3 3
      cli/main.go

+ 3 - 1
cli/cmd/errors.go

@@ -10,6 +10,7 @@ import (
 	api "github.com/porter-dev/porter/api/client"
 	"github.com/porter-dev/porter/api/types"
 	"github.com/porter-dev/porter/cli/cmd/config"
+	cliErrors "github.com/porter-dev/porter/cli/cmd/errors"
 )
 
 var ErrNotLoggedIn error = errors.New("You are not logged in.")
@@ -52,7 +53,8 @@ func checkLoginAndRun(args []string, runner func(user *types.GetAuthenticatedUse
 			return nil
 		}
 
-		red.Fprintf(os.Stderr, "Error: %v\n", err.Error())
+		cliErrors.GetErrorHandler().HandleError(err)
+
 		return err
 	}
 

+ 3 - 3
cli/main.go

@@ -4,7 +4,6 @@
 package main
 
 import (
-	"fmt"
 	"os"
 	"time"
 
@@ -17,13 +16,14 @@ import (
 
 func main() {
 	if errors.SentryDSN != "" {
-		fmt.Println("initialising sentry")
-
 		err := sentry.Init(sentry.ClientOptions{
 			Dsn:         errors.SentryDSN,
 			Environment: "cli",
 			Debug:       config.Version == "dev",
 			Release:     config.Version,
+			IgnoreErrors: []string{
+				"Forbidden",
+			},
 		})
 
 		if err != nil {