cycloidio / terracost

Cloud cost estimation for Terraform in your CLI
MIT License
278 stars 29 forks source link

cost: store the errors instead of failing #26

Closed patrislav closed 3 years ago

patrislav commented 3 years ago

Abstract

Whenever a cost.State is created using cost.NewState function, the previous behaviour was to fail it the first time an error is encountered (e.g. when no product matching the query was found.)

This PR adds a new field on Component to store the error. It is used by cost.NewState instead of returning the error from the function. The errors can then be read from a ResourceDiff by using the Errors method.

Closes #17

patrislav commented 3 years ago

Updated to pass the CI