Skip to content

Commit

Permalink
Merge pull request #45 from AntonioMeireles/moreErrorHandling
Browse files Browse the repository at this point in the history
More error handling
  • Loading branch information
AntonioMeireles committed Jan 5, 2016
2 parents 7a4ecaa + e6d184a commit f6522e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ func (running *sessionContext) boot(slt int, rawArgs *viper.Viper) (err error) {
for {
select {
case <-time.After(30 * time.Second):
if p, ee := os.FindProcess(c.Process.Pid); ee == nil {
p.Kill()
}
vm.errch <- fmt.Errorf("Unable to grab VM's pid and IP after " +
"30s (!)... Aborting")
return
Expand Down Expand Up @@ -375,6 +378,8 @@ func nfsSetup() (err error) {

if err = cmd.Run(); err != nil {
err = fmt.Errorf("unable to validate %s (see above)", exportsF)
// getting back to where we were
ioutil.WriteFile(exportsF, buf, os.ModeAppend)
}
return
}()
Expand Down

0 comments on commit f6522e2

Please sign in to comment.