Permalink
Browse files

Attempt to resolve issue #63, exit with a non-zero exit status if the…

… pipeline throws an exception.
  • Loading branch information...
ndw committed Jan 29, 2013
1 parent 932ebb9 commit dae9687eb427dbb32268d88980e72825689f5ba9
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/com/xmlcalabash/drivers/Main.java
@@ -63,6 +63,7 @@
public class Main {
private static boolean errors = false;
private static QName _code = new QName("code");
private static int exitStatus = 0;
private XProcRuntime runtime = null;
private boolean readStdin = false;
private Logger logger = Logger.getLogger(this.getClass().getName());
@@ -74,6 +75,7 @@
public static void main(String[] args) throws SaxonApiException, IOException, URISyntaxException {
Main main = new Main();
main.run(args);
System.exit(exitStatus);
}
public void run(String[] args) throws SaxonApiException, IOException, URISyntaxException {
@@ -414,6 +416,7 @@ public void run(String[] args) throws SaxonApiException, IOException, URISyntaxE
err.printStackTrace();
}
} catch (Exception err) {
exitStatus = 1;
error(logger, null, "Pipeline failed: " + err.toString(), null);
if (err.getCause() != null) {
Throwable cause = err.getCause();

0 comments on commit dae9687

Please sign in to comment.