Skip to content

Commit 238b4e1

Browse files
committed
chore: remove log.Panic() in create/start commands
Signed-off-by: Daniel Hu <[email protected]>
1 parent 37b6527 commit 238b4e1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cmd/devstream/create.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"log"
4+
"fmt"
55

66
"github.com/spf13/cobra"
77

@@ -17,7 +17,7 @@ var createCMD = &cobra.Command{
1717

1818
func createCMDFunc(cmd *cobra.Command, args []string) {
1919
err := create.Create()
20-
if err != nil {
21-
log.Panic(err)
20+
if err.Error() != "^C" {
21+
fmt.Printf("Failed with error: %s", err)
2222
}
2323
}

cmd/devstream/start.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package main
22

33
import (
4+
"fmt"
5+
46
"github.com/spf13/cobra"
57

68
"github.com/devstream-io/devstream/internal/pkg/start"
7-
"github.com/devstream-io/devstream/pkg/util/log"
89
)
910

1011
var startCMD = &cobra.Command{
@@ -16,7 +17,7 @@ var startCMD = &cobra.Command{
1617

1718
func startCMDFunc(_ *cobra.Command, _ []string) {
1819
err := start.Start()
19-
if err != nil {
20-
log.Fatal(err)
20+
if err.Error() != "^C" {
21+
fmt.Printf("Failed with error: %s", err)
2122
}
2223
}

0 commit comments

Comments
 (0)