Skip to content

Commit

Permalink
Merge pull request #31 from codecrafters-io/move-exception-capture
Browse files Browse the repository at this point in the history
CC-1272 Move exception capture
  • Loading branch information
libmartinito authored Jun 14, 2024
2 parents e75d94a + 373f0a7 commit 24b35f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/utils/codecrafters_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ func (c CodecraftersClient) FetchBuild(buildId string) (FetchBuildStatusResponse
}

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

sentry.CaptureException(err)
return err
return fmt.Errorf("unexpected build status: %s", fetchBuildResponse.Status)
}

return nil
Expand All @@ -207,6 +204,10 @@ func (c CodecraftersClient) FetchBuild(buildId string) (FetchBuildStatusResponse
)

if err != nil {
if fetchBuildResponse.Status != "failure" && fetchBuildResponse.Status != "success" {
sentry.CaptureException(err)
}

return FetchBuildStatusResponse{}, err
}

Expand Down

0 comments on commit 24b35f8

Please sign in to comment.