Permalink
Browse files

Print a stack trace when attaching fails.

  • Loading branch information...
sk89q committed Jun 22, 2013
1 parent 6c93fd8 commit e32d9aa984211910824e169e319ed0df432d86b4
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/com/sk89q/warmroast/WarmRoast.java
@@ -222,6 +222,7 @@ public static void main(String[] args) throws AgentLoadException {
System.err.println("Attaching to PID " + opt.pid + "...");
} catch (AttachNotSupportedException | IOException e) {
System.err.println("Failed to attach VM by PID " + opt.pid);
e.printStackTrace();
System.exit(1);
}
} else if (opt.vmName != null) {
@@ -234,14 +235,14 @@ public static void main(String[] args) throws AgentLoadException {
break;
} catch (AttachNotSupportedException | IOException e) {
System.err.println("Failed to attach VM by name '" + opt.vmName + "'");
e.printStackTrace();
System.exit(1);
}
}
}
}
if (vm == null) {
List<VirtualMachineDescriptor> descriptors = VirtualMachine.list();
System.err.println("Choose a VM:");
@@ -286,6 +287,7 @@ public int compare(VirtualMachineDescriptor o1,
} catch (AttachNotSupportedException | IOException e) {
System.err.println("");
System.err.println("Failed to attach VM");
e.printStackTrace();
System.exit(1);
}
}

0 comments on commit e32d9aa

Please sign in to comment.