Skip to content

Commit

Permalink
fix: return proper error when HTTP calls fail on validate (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed May 4, 2023
1 parent 2f8b05c commit 7189614
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/defaulter.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ func (d *Defaulter) getEntitySchema(entityType string) (map[string]interface{},
return schema, err
}
resp, err := d.client.Do(d.ctx, req, &schema)
if resp == nil {
return schema, fmt.Errorf("invalid HTTP response: %w", err)
}
// in case the schema is not found - like in case of EE features,
// no error should be returned.
if resp.StatusCode == http.StatusNotFound {
Expand Down

0 comments on commit 7189614

Please sign in to comment.