Skip to content

Commit

Permalink
added 412 to error codes that are checked (scaleway#1306)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémy Léone <rleone@scaleway.com>
Co-authored-by: Jules Castéran <jcasteran@scaleway.com>
  • Loading branch information
3 people committed Jun 17, 2022
1 parent b204ca7 commit bf91b11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scaleway/validate_cassettes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func TestAccScalewayCassettes_Validator(t *testing.T) {

func checkErrorCode(c *cassette.Cassette) error {
for _, i := range c.Interactions {
if !checkErrCode(i, c, http.StatusConflict, http.StatusInternalServerError) {
return fmt.Errorf("status: %v founded on %s. method: %s, url %s", i.Code, c.Name, i.Request.Method, i.Request.URL)
if !checkErrCode(i, c, http.StatusConflict, http.StatusInternalServerError, http.StatusPreconditionFailed) {
return fmt.Errorf("status: %v found on %s. method: %s, url %s\nrequest body = %v\nresponse body = %v", i.Code, c.Name, i.Request.Method, i.Request.URL, i.Request.Body, i.Response.Body)
}
}

Expand All @@ -67,7 +67,7 @@ func checkErrCode(i *cassette.Interaction, c *cassette.Cassette, codes ...int) b

for _, httpCode := range codes {
if i.Code == httpCode {
return true
return false
}
}

Expand Down

0 comments on commit bf91b11

Please sign in to comment.