-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
ionos_create_machine.go
Outdated
} | ||
err = d.CreateLanIfNeeded() | ||
if err != nil { | ||
return err |
There was a problem hiding this comment.
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.
return err | |
return fmt.Errorf("error creating LAN: %w", err) |
ionos_create_machine.go
Outdated
} | ||
|
||
func (d *Driver) CreateLanIfNeeded() (err error) { | ||
if d.LanId == "" { |
There was a problem hiding this comment.
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
if d.LanId == "" { | |
if d.LanId != "" { | |
return nil | |
} | |
/// rest of the func not nested |
ionos_create_machine.go
Outdated
} | ||
|
||
func (d *Driver) CreateIonosMachine() (err error) { | ||
log.Infof("Creating SSH key123...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Infof("Creating SSH key123...") | |
log.Infof("Creating SSH key...") |
The base branch was changed.
|
What does this fix or implement?
Checklist
feat:
/fix:
/doc:
/test:
/refactor:
)