Skip to content

Commit 8a6927b

Browse files
edwardrfedw-defang
andauthored
HACK: do not return ErrDeploymentFailed returned from tail (#1023)
to make sure AI debugger is triggered when cd exit abnormally Co-authored-by: Edward J <[email protected]>
1 parent 28f716c commit 8a6927b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/cli/command/compose.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,14 @@ func makeComposeUpCmd() *cobra.Command {
216216
if err := cli.Tail(tailCtx, provider, project.Name, tailOptions); err != nil {
217217
term.Debug("Tail stopped with", err)
218218

219+
// FIXME: This code needs to be refactored
219220
if connect.CodeOf(err) == connect.CodePermissionDenied {
220221
// If tail fails because of missing permission, we wait for the deployment to finish
221222
term.Warn("Unable to tail logs. Waiting for the deployment to finish.")
222223
<-tailCtx.Done()
223224
// Get the actual error from the context so we won't print "Error: missing tail permission"
224225
err = context.Cause(tailCtx)
225-
} else if !(errors.Is(tailCtx.Err(), context.Canceled) || errors.Is(tailCtx.Err(), context.DeadlineExceeded)) {
226+
} else if !(errors.Is(tailCtx.Err(), context.Canceled) || errors.Is(tailCtx.Err(), context.DeadlineExceeded) || errors.As(err, &pkg.ErrDeploymentFailed{})) {
226227
return err // any error other than cancelation
227228
}
228229

0 commit comments

Comments
 (0)