Skip to content

Commit

Permalink
feat: Add monitoring for unexpected build status
Browse files Browse the repository at this point in the history
  • Loading branch information
libmartinito committed May 29, 2024
1 parent c0a2a41 commit 16d8bd5
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 16d8bd5

Please sign in to comment.