Skip to content

Commit

Permalink
Propagate the Saxon return code to the shell
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Oct 24, 2024
1 parent 564297b commit 5b62f75
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bin/docbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ def run(self):
if self.catalogs:
args.append("-catalog:" + ";".join(self.catalogs))

rc = 0
jopt = self.config.get("java-options", [])
if self.debug:
print(self._java)
Expand All @@ -592,7 +593,9 @@ def run(self):
print(f"\t{item}")
else:
cmd = [self._java] + jopt + ["-cp", cp] + [self.config["class"]] + args
subprocess.call(cmd)
rc = subprocess.call(cmd)

return rc


if __name__ == "__main__":
Expand All @@ -602,7 +605,7 @@ def run(self):
try:
docbook = JavaClassRunner(sys.argv[1:])
docbook.compute_dependencies()
docbook.run()
sys.exit(docbook.run())
except JavaClassRunnerException as err:
print(str(err))
sys.exit(1)

0 comments on commit 5b62f75

Please sign in to comment.