Skip to content

Commit

Permalink
Merge pull request #4 from dalvizu/master
Browse files Browse the repository at this point in the history
Log exceptions correctly
  • Loading branch information
ShimiTaNaka committed Mar 30, 2016
2 parents 5b6890e + cf8c729 commit 6ec4b0a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 244 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pom.xml.versionsBackup
pom.xml.next
release.properties
work/
.idea/
.idea/
vagrant.iml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
return this.wrapper.executeCommand("destroy", arg);
} catch (IOException e) {
wrapper.log("Error starting up vagrant, caught IOException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
} catch (InterruptedException e) {
wrapper.log("Error starting up vagrant, caught InterruptedException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
return this.wrapper.executeCommand("provision", arg);
} catch (IOException e) {
listener.getLogger().println("Error starting up vagrant, caught IOException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
} catch (InterruptedException e) {
listener.getLogger().println("Error starting up vagrant, caught InterruptedException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
return this.wrapper.executeCommand("ssh", arg);
} catch (IOException e) {
wrapper.log("Error starting up vagrant, caught IOException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
} catch (InterruptedException e) {
wrapper.log("Error starting up vagrant, caught InterruptedException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
return this.wrapper.executeCommand("up", arg, additinalVars);
} catch (IOException e) {
wrapper.log("Error starting up vagrant, caught IOException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
} catch (InterruptedException e) {
wrapper.log("Error starting up vagrant, caught InterruptedException, message: " + e.getMessage());
wrapper.log(e.getStackTrace());
wrapper.log(e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,16 @@ protected void parseVagrantEnvironment() {
*
* @param data
*/
public void log(Object data) {
public void log(String data) {
listener.getLogger().print("[ vagrant ]: ");
listener.getLogger().println(data);
}

public void log(Throwable exception) {
listener.getLogger().print("[ vagrant ]: ");
exception.printStackTrace(listener.getLogger());
}

/**
*
* @param command
Expand Down
234 changes: 0 additions & 234 deletions vagrant.iml

This file was deleted.

0 comments on commit 6ec4b0a

Please sign in to comment.