File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
components/gitpod-cli/cmd Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,10 @@ USER gitpod
126
126
}
127
127
}
128
128
129
- openCmd .RunE (cmd , []string {v .File })
129
+ err = openCmd .RunE (cmd , []string {v .File })
130
+ if err != nil {
131
+ return err
132
+ }
130
133
}
131
134
return openCmd .RunE (cmd , []string {".gitpod.yml" })
132
135
},
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ var openCmd = &cobra.Command{
26
26
RunE : func (cmd * cobra.Command , args []string ) error {
27
27
// TODO(ak) use NotificationService.NotifyActive supervisor API instead
28
28
29
- ctx , cancel := context .WithTimeout (cmd .Context (), 5 * time .Second )
29
+ ctx , cancel := context .WithTimeout (cmd .Context (), 10 * time .Second )
30
30
defer cancel ()
31
31
32
32
client , err := supervisor .New (ctx )
@@ -57,12 +57,22 @@ var openCmd = &cobra.Command{
57
57
58
58
if wait {
59
59
pargs = append (pargs , "--wait" )
60
+ ctx = cmd .Context ()
60
61
}
61
- c := exec .CommandContext (cmd . Context () , pcmd , append (pargs [1 :], args ... )... )
62
+ c := exec .CommandContext (ctx , pcmd , append (pargs [1 :], args ... )... )
62
63
c .Stdin = os .Stdin
63
64
c .Stdout = os .Stdout
64
65
c .Stderr = os .Stderr
65
- return c .Run ()
66
+ err = c .Run ()
67
+ if err != nil {
68
+ if ctx .Err () != nil {
69
+ return xerrors .Errorf ("editor failed to open in time: %w" , ctx .Err ())
70
+ }
71
+
72
+ return xerrors .Errorf ("editor failed to open: %w" , err )
73
+ }
74
+
75
+ return nil
66
76
},
67
77
}
68
78
You can’t perform that action at this time.
0 commit comments