Skip to content

Commit 0774faf

Browse files
authored
bad request for force abort (#6475)
1 parent 3356c63 commit 0774faf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/pipeline/CdHandler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/devtron-labs/devtron/pkg/pipeline/workflowStatus"
3636
bean5 "github.com/devtron-labs/devtron/pkg/pipeline/workflowStatus/bean"
3737
"github.com/devtron-labs/devtron/pkg/workflow/cd"
38+
"net/http"
3839
"os"
3940
"path/filepath"
4041
"strconv"
@@ -204,6 +205,8 @@ func (impl *CdHandlerImpl) CancelStage(workflowRunnerId int, forceAbort bool, us
204205
impl.Logger.Errorw("error in terminating dangling workflows", "cancelWfDtoRequest", cancelWfDtoRequest, "err", err)
205206
// ignoring error here in case of force abort, confirmed from product
206207
}
208+
} else if err != nil && strings.Contains(err.Error(), "cannot find workflow") {
209+
return 0, &util.ApiError{Code: "200", HttpStatusCode: http.StatusBadRequest, UserMessage: err.Error()}
207210
} else if err != nil {
208211
impl.Logger.Error("cannot terminate wf runner", "err", err)
209212
return 0, err

0 commit comments

Comments
 (0)