diff --git a/cmd/createSnapshot.go b/cmd/createSnapshot.go index 50cad5eb..1c3ae562 100644 --- a/cmd/createSnapshot.go +++ b/cmd/createSnapshot.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + "go.uber.org/zap" ) var createSnapshotCmd = &cobra.Command{ @@ -38,7 +39,7 @@ var createSnapshotCmd = &cobra.Command{ } if err := svc.CreateSnapshot(); err != nil { - return fmt.Errorf("failed to create snapshot: %w", err) + l.Sugar().Fatal("failed to create snapshot", zap.Error(err)) } return nil diff --git a/cmd/restoreSnapshot.go b/cmd/restoreSnapshot.go index 66588c9d..6eaea4cd 100644 --- a/cmd/restoreSnapshot.go +++ b/cmd/restoreSnapshot.go @@ -41,7 +41,7 @@ Follow the snapshot docs if you need to convert the snapshot to a different sche } if err := svc.RestoreSnapshot(); err != nil { - l.Fatal("failed to restore snapshot", zap.Error(err)) + l.Sugar().Fatal("failed to restore snapshot", zap.Error(err)) } return nil