You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/rofl/machine/show.go
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ package machine
3
3
import (
4
4
"context"
5
5
"encoding/binary"
6
+
"encoding/json"
6
7
"fmt"
7
8
"net"
8
9
"strings"
@@ -63,10 +64,21 @@ var showCmd = &cobra.Command{
63
64
iferr!=nil {
64
65
// The "instance not found" error originates from Rust code, so we can't compare it nicely here.
65
66
ifstrings.Contains(err.Error(), "instance not found") {
66
-
cobra.CheckErr("Machine instance not found.\nTip: This often happens when instances expire. Run `oasis rofl deploy --replace-machine` to rent a new one.")
67
+
switchcommon.OutputFormat() {
68
+
casecommon.FormatJSON:
69
+
fmt.Printf("{ \"error\": \"%s\" }\n", err)
70
+
casecommon.FormatText:
71
+
cobra.CheckErr("Machine instance not found.\nTip: This often happens when instances expire. Run `oasis rofl deploy --replace-machine` to rent a new one.")
0 commit comments