Skip to content

Commit a72a281

Browse files
authored
Merge pull request #24 from codecrafters-io/add-monitoring
CC-1212 Add monitoring for unexpected build status in cli
2 parents c0a2a41 + 16d8bd5 commit a72a281

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/utils/codecrafters_client.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"time"
99

1010
retry "github.com/avast/retry-go"
11+
"github.com/getsentry/sentry-go"
1112
"github.com/levigross/grequests"
1213
"github.com/mitchellh/go-wordwrap"
1314
)
@@ -190,7 +191,10 @@ func (c CodecraftersClient) FetchBuild(buildId string) (FetchBuildStatusResponse
190191
}
191192

192193
if fetchBuildResponse.Status != "failure" && fetchBuildResponse.Status != "success" {
193-
return fmt.Errorf("unexpected build status: %s", fetchBuildResponse.Status)
194+
err = fmt.Errorf("unexpected build status: %s", fetchBuildResponse.Status)
195+
196+
sentry.CaptureException(err)
197+
return err
194198
}
195199

196200
return nil

0 commit comments

Comments
 (0)