Skip to content

Commit

Permalink
Add Exit Codes to 'latexmlpost' and 'latexmlmath' (Fixes brucemiller#…
Browse files Browse the repository at this point in the history
…1417) (brucemiller#1614)

* Add exit codes to latexmlpost

* Add exit code to latexmlmath

* latexml{post,math}: Exit 1 iff fatal

This commit updates the exit behavior of latexmlpost and latexmlmath to
only exit with code 1 if a fatal error occured.

Co-authored-by: Evgeny Epifanovsky <epif@q-chem.com>
  • Loading branch information
tkw1536 and epifanovsky authored Aug 24, 2021
1 parent 30b63f3 commit 6aa4a10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/latexmlmath
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,14 @@ if ($xmath) {
outputXML($result->findnode('//ltx:XMath'), $xmath); }

my $status = $latexml->getStatusMessage;
my $code = $latexml->getStatusCode;
# Should be combined with $post's status!
# But better approach will be to manage all through LaTeXML.pm!!
my $runtime = RunTime($starttime);
NoteLog("Conversion complete: " . $status);
NoteSTDERR("Conversion complete: " . $status . " (reqd. $runtime)");
UseLog(undef);
exit $code == 3 ? 1 : 0;

#======================================================================
# Helpers
Expand Down
1 change: 1 addition & 0 deletions bin/latexmlpost
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ NoteSTDERR("Postprocessing " . ($code == 3 ? 'failed' : 'complete') . " " . $sta
UseLog(undef);
CheckDebuggable();
UseSTDERR(undef);
exit $code == 3 ? 1 : 0;

#======================================================================
# helpers
Expand Down

0 comments on commit 6aa4a10

Please sign in to comment.