Skip to content

Commit

Permalink
Merge pull request #24 from codecrafters-io/add-monitoring
Browse files Browse the repository at this point in the history
CC-1212 Add monitoring for unexpected build status in cli
  • Loading branch information
libmartinito authored May 31, 2024
2 parents c0a2a41 + 16d8bd5 commit a72a281
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/utils/codecrafters_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

retry "github.com/avast/retry-go"
"github.com/getsentry/sentry-go"
"github.com/levigross/grequests"
"github.com/mitchellh/go-wordwrap"
)
Expand Down Expand Up @@ -190,7 +191,10 @@ func (c CodecraftersClient) FetchBuild(buildId string) (FetchBuildStatusResponse
}

if fetchBuildResponse.Status != "failure" && fetchBuildResponse.Status != "success" {
return fmt.Errorf("unexpected build status: %s", fetchBuildResponse.Status)
err = fmt.Errorf("unexpected build status: %s", fetchBuildResponse.Status)

sentry.CaptureException(err)
return err
}

return nil
Expand Down

0 comments on commit a72a281

Please sign in to comment.