Skip to content

Commit

Permalink
fix: Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mlec1 committed Dec 29, 2024
1 parent ee8348d commit b41a6d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion cmd/elastic_ip_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func (c *elasticIPCreateCmd) cmdRun(_ *cobra.Command, _ []string) error {
}

_, err = client.Wait(ctx, op, v3.OperationStateSuccess)
return err
if err != nil {
return fmt.Errorf("exoscale: error while waiting for Elastic IP creation: %w", err)
}

return nil
})
if err != nil {
return err
Expand Down
6 changes: 5 additions & 1 deletion cmd/elastic_ip_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ func (c *elasticIPDeleteCmd) cmdRun(_ *cobra.Command, _ []string) error {
}

_, err = client.Wait(ctx, op, v3.OperationStateSuccess)
return err
if err != nil {
return fmt.Errorf("exoscale: error while waiting for Elastic IP deletion: %w", err)
}

return nil
})
}

Expand Down
3 changes: 0 additions & 3 deletions cmd/elastic_ip_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ func (c *elasticIPShowCmd) cmdRun(_ *cobra.Command, _ []string) error {

if elasticIP.Healthcheck != nil {
out.Type = "managed"
// Message for reviewer:
// I don't really like to use this function for only one this parameter, if you have a better solution, please feel free to suggest it
// TODO: remove comment before merging
out.HealthcheckMode = utils.NonEmptyStringPtr(string(elasticIP.Healthcheck.Mode))
out.HealthcheckPort = &elasticIP.Healthcheck.Port
out.HealthcheckURI = &elasticIP.Healthcheck.URI
Expand Down

0 comments on commit b41a6d8

Please sign in to comment.