Index: CommandLine.java =================================================================== --- CommandLine.java (revision 1654) +++ CommandLine.java (working copy) @@ -120,6 +120,18 @@ } } + /** + * @exception CmdLineException If an error is detected. + */ + private static void assertExitSuccess(int exitCode, String errMsg) + throws CmdLineException { + if (exitCode != 0) { + throw new CmdLineException(errMsg.length() > 0 ? errMsg : + "Command failed with exit " + + "code " + exitCode); + } + } + /** * Runs the process and returns the results. * @param svnArguments The arguments to pass to the command-line @@ -138,9 +150,8 @@ try { String errMessage = errPumper.toString(); - if (errMessage.length() > 0) { - throw new CmdLineException(errMessage); - } + assertExitSuccess(proc.exitValue(), errMessage); + String outputString = outPumper.toString(); notifyFromSvnOutput(outputString); @@ -170,9 +181,7 @@ try { String errMessage = errPumper.toString(); - if (errMessage.length() > 0) { - throw new CmdLineException(errMessage); - } + assertExitSuccess(proc.exitValue(), errMessage); byte[] bytes = outPumper.getBytes(); String notifyMessage = "";