Skip to content

Commit cf7b046

Browse files
Andariusclaude
andauthored
fix(baremetal): handle errors in offer list command (#5280)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3ccff10 commit cf7b046

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/namespaces/baremetal/v1/custom_offer.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ func serverOfferListBuilder(c *core.Command) *core.Command {
8888

8989
client := core.ExtractClient(ctx)
9090
baremetalAPI := baremetal.NewAPI(client)
91-
offers, _ := baremetalAPI.ListOffers(req, scw.WithAllPages())
91+
offers, err := baremetalAPI.ListOffers(req, scw.WithAllPages())
92+
if err != nil {
93+
return nil, err
94+
}
9295

9396
productAPI := productcatalog.NewPublicCatalogAPI(client)
94-
environmentalImpact, _ := productAPI.ListPublicCatalogProducts(
97+
environmentalImpact, err := productAPI.ListPublicCatalogProducts(
9598
&productcatalog.PublicCatalogAPIListPublicCatalogProductsRequest{
9699
ProductTypes: []productcatalog.ListPublicCatalogProductsRequestProductType{
97100
productcatalog.ListPublicCatalogProductsRequestProductTypeElasticMetal,
@@ -100,6 +103,9 @@ func serverOfferListBuilder(c *core.Command) *core.Command {
100103
},
101104
scw.WithAllPages(),
102105
)
106+
if err != nil {
107+
return nil, err
108+
}
103109

104110
var unitOfMeasure productcatalog.PublicCatalogProductUnitOfMeasureCountableUnit
105111
if req.SubscriptionPeriod == "monthly" {

0 commit comments

Comments
 (0)