Skip to content

Commit

Permalink
Attempt to resolve issue #63, exit with a non-zero exit status if the…
Browse files Browse the repository at this point in the history
… pipeline throws an exception.
  • Loading branch information
ndw committed Jan 29, 2013
1 parent 932ebb9 commit dae9687
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/com/xmlcalabash/drivers/Main.java
Expand Up @@ -63,6 +63,7 @@
public class Main { public class Main {
private static boolean errors = false; private static boolean errors = false;
private static QName _code = new QName("code"); private static QName _code = new QName("code");
private static int exitStatus = 0;
private XProcRuntime runtime = null; private XProcRuntime runtime = null;
private boolean readStdin = false; private boolean readStdin = false;
private Logger logger = Logger.getLogger(this.getClass().getName()); private Logger logger = Logger.getLogger(this.getClass().getName());
Expand All @@ -74,6 +75,7 @@ public class Main {
public static void main(String[] args) throws SaxonApiException, IOException, URISyntaxException { public static void main(String[] args) throws SaxonApiException, IOException, URISyntaxException {
Main main = new Main(); Main main = new Main();
main.run(args); main.run(args);
System.exit(exitStatus);
} }


public void run(String[] args) throws SaxonApiException, IOException, URISyntaxException { public void run(String[] args) throws SaxonApiException, IOException, URISyntaxException {
Expand Down Expand Up @@ -414,6 +416,7 @@ public void run(String[] args) throws SaxonApiException, IOException, URISyntaxE
err.printStackTrace(); err.printStackTrace();
} }
} catch (Exception err) { } catch (Exception err) {
exitStatus = 1;
error(logger, null, "Pipeline failed: " + err.toString(), null); error(logger, null, "Pipeline failed: " + err.toString(), null);
if (err.getCause() != null) { if (err.getCause() != null) {
Throwable cause = err.getCause(); Throwable cause = err.getCause();
Expand Down

0 comments on commit dae9687

Please sign in to comment.