<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Paco,<br><br><div>> No, Ant checks for the return code : I invoke the java task with the failonerror<br>> attribute (http://ant.apache.org/manual/Tasks/java.html#failonerror) which<br>> explicitly mentions the result code. The result code is set in the Java code<br>> with the System.exit() method.<br>yes, that's what ant does. My question was how you decide that mkgmap failed.<br><br>> <br>> > so maybe we can check whether anything was<br>> > written to stderr, but sometimes we use this file also for<br>> > important hints like this:<br>> > "WARNING: input files have different code pages"<br>> <br>> I agree with you, mkgmap outputs lots of warnings, this workaround would be<br>> tricky at best. It would work if we output information and warnings to stdout<br>> and errors and exceptions to stderr but that requires a check on the complete<br>> codebase.<br>> <br>> I ran a grep for System.exit on the codebase and found several calls to<br>> System.exit(), adding a few of them in the right places (e.g. at the end of the<br>> options processing, catching any exception mkgmap can't deal with...) should do<br>> the trick.<br>> Forgive me if I'm wrong here, it's been 10 years since I wrote a single line of<br>> java code.<br><br>your welcome. In fact only very few of the System.exit() calls are reachable if<br>your execute mkgmap main. They are used in stand-alone programs.<br><br>Anyhow, I think we should at least manage to stop with non zero return code <br>when parameter checks fail or input files are missing or if one output file <br>was not not completely written.<br>It is much more difficult to keep track of error messages regarding the quality of the<br>output.<br><br>> > BTW: Also splitter doesn't make sure that it ends<br>> > with a non-zero return code in case of errors, but<br>> > it tries to do so.<br>> <br>> As far as I remember, I've run into incorrect options or missing file errors,<br>> splitter always behaved as expected.<br>yes, those typical user errors are probably all catched.<br>One example that is not: if the input is an invalid o5m file you might see a traceback but splitter<br>ends with rc 0. <br><br>Gerd<br></div>                                            </div></body>
</html>