Skip to content

Commit

Permalink
add fleaky case for silence build error fail and run out of time (#4094)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemarina authored Jul 10, 2024
1 parent 837d4e8 commit f8d5fe9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions cli/azd/pkg/tools/azcli/webapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,31 @@ func appServiceRepositoryHost(
}

func resumeDeployment(err error, progressLog func(msg string)) bool {
if strings.Contains(err.Error(), "empty deployment status id") {
errorMessage := err.Error()
if strings.Contains(errorMessage, "empty deployment status id") {
progressLog("Deployment status id is empty. Failed to enable tracking runtime status." +
"Resuming deployment without tracking status.")
return true
}

if strings.Contains(err.Error(), "response or its properties are empty") {
if strings.Contains(errorMessage, "response or its properties are empty") {
progressLog("Response or its properties are empty. Failed to enable tracking runtime status." +
"Resuming deployment without tracking status.")
return true
}

if strings.Contains(errorMessage, "failed to start within the allotted time") {
progressLog("Deployment with tracking status failed to start within the allotted time." +
"Resuming deployment without tracking status.")
return true
}

if strings.Contains(errorMessage, "the build process failed") && !strings.Contains(errorMessage, "logs for more info") {
progressLog("Failed to enable tracking runtime status." +
"Resuming deployment without tracking status.")
return true
}

var httpErr *azcore.ResponseError
if errors.As(err, &httpErr) && httpErr.StatusCode == 404 {
progressLog("Resource not found. Failed to enable tracking runtime status." +
Expand Down

0 comments on commit f8d5fe9

Please sign in to comment.