Skip to content

Commit

Permalink
fix: return proper error when HTTP calls fail on validate
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed Mar 17, 2023
1 parent ff70966 commit 525daae
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 525daae

Please sign in to comment.