Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Exit on virtualbox initialization error #215

Merged
merged 2 commits into from
Aug 11, 2014
Merged

Exit on virtualbox initialization error #215

merged 2 commits into from
Aug 11, 2014

Conversation

daghack
Copy link
Contributor

@daghack daghack commented Aug 8, 2014

Just a minor fix to insure that the program does not continue if the call to driver.Register returns a non-nil error.

@tianon
Copy link
Contributor

tianon commented Aug 8, 2014

There are a few other cases of driver.Register, can you add some similar logic for them too?

@@ -39,7 +39,10 @@ const (
)

func init() {
driver.Register("virtualbox", InitFunc)
if err := driver.Register("virtualbox", InitFunc); err != nil {
fmt.Printf("Failed to initialize driver. Error : %s", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, this probably out to either be log.Fatal or use fmt.Fprintf and go to stderr, so we start getting closer to good practices all around in this project. :)

@daghack
Copy link
Contributor Author

daghack commented Aug 8, 2014

I could only find one other instance of driver.Register and it now has similar logic. Silly of me not to have gotten that, too. Also, the message is now going to stderr :)

@tianon
Copy link
Contributor

tianon commented Aug 8, 2014

LGTM

@tianon
Copy link
Contributor

tianon commented Aug 8, 2014

(this one's especially for you @tiborvass)

@tiborvass
Copy link

@tianon haha! 👍

@SvenDowideit
Copy link
Contributor

LGTM

SvenDowideit pushed a commit that referenced this pull request Aug 11, 2014
Exit on virtualbox initialization error
@SvenDowideit SvenDowideit merged commit bd591d5 into boot2docker:master Aug 11, 2014
SvenDowideit added a commit to SvenDowideit/boot2docker-cli that referenced this pull request Nov 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants