Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/catch driver errors #110

Merged
merged 13 commits into from
May 29, 2024
Merged

Conversation

rmocanu-ionos
Copy link
Contributor

What does this fix or implement?

Checklist

  • PR name added as appropriate (e.g. feat:/fix:/doc:/test:/refactor:)
  • Tests added or updated
  • Documentation updated
  • Sonar Cloud Scan
  • Changelog updated and version incremented (label: upcoming release)
  • Github Issue linked if any
  • Jira task updated

}
err = d.CreateLanIfNeeded()
if err != nil {
return err
Copy link
Contributor

@avirtopeanu-ionos avirtopeanu-ionos May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just a nitpick)

it would be easier to rather append the error here rather than in the called function i.e.

Suggested change
return err
return fmt.Errorf("error creating LAN: %w", err)

}

func (d *Driver) CreateLanIfNeeded() (err error) {
if d.LanId == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just a nitpick)

It would be easier to read if this is an early return

Suggested change
if d.LanId == "" {
if d.LanId != "" {
return nil
}
/// rest of the func not nested

}

func (d *Driver) CreateIonosMachine() (err error) {
log.Infof("Creating SSH key123...")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Infof("Creating SSH key123...")
log.Infof("Creating SSH key...")

Base automatically changed from fix/ip-not-set-nat to master May 29, 2024 09:15
@rmocanu-ionos rmocanu-ionos dismissed avirtopeanu-ionos’s stale review May 29, 2024 09:15

The base branch was changed.

@rmocanu-ionos rmocanu-ionos merged commit bbc8bad into master May 29, 2024
4 checks passed
@rmocanu-ionos rmocanu-ionos deleted the refactor/catch-driver-errors branch May 29, 2024 09:19
Copy link

sonarcloud bot commented May 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants