Menu

#27 Exception but still exit code 0

open
nobody
None
5
2004-12-04
2004-12-04
gcey
No

EMMA: 2.0.4217
Java: Solaris_JDK_1.2.2_11

When I get a
com.vladium.emma.EMMARuntimeException:
[CLASS_STAMP_MISMATCH]
I still get an exit code 0 (even if I use the "-exit" flag).
Therefore I cannot react accordingly in my shell script.

Here you see, what I did and the result:

>java -cp /.../emma.jar emma report -exit -r txt -in
coverage.es
EMMA: processing input files ...
EMMA: 1 file(s) read and merged in 129 ms
com.vladium.emma.EMMARuntimeException:
[CLASS_STAMP_MISMATCH] runtime version of class
[...] in the coverage data is not consistent with the
version of this class in the metadata, possibly because
stale met
adata is being used for report generation.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>
(RuntimeException.java:40)
at
com.vladium.util.exception.AbstractRuntimeException.<ini
t>(AbstractRuntimeException.java:124)
at com.vladium.emma.EMMARuntimeException.<init>
(Compiled Code)
at com.vladium.emma.report.ReportDataModel.getView
(Compiled Code)
at
com.vladium.emma.report.AbstractReportGenerator.initiali
ze(Compiled Code)
at com.vladium.emma.report.txt.ReportGenerator.process
(Compiled Code)
at com.vladium.emma.report.ReportProcessor._run
(Compiled Code)
at com.vladium.emma.Processor.run(Processor.java:54)
at com.vladium.emma.report.reportCommand.run
(Compiled Code)
at emma.main(emma.java:40)
>echo $?
0

I think, this should not be 0.

In another error case the exit code ist 1 (as expected):

>java -cp /.../emma.jar emma xxx
Exception in thread "main"
java.lang.IllegalArgumentException: unknown command:
[xxx]
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:35)
at java.lang.RuntimeException.<init>
(RuntimeException.java:40)
at java.lang.IllegalArgumentException.<init>
(IllegalArgumentException.java:36)
at com.vladium.emma.Command.create
(Command.java:51)
at emma.main(emma.java:39)
>echo $?
1

Discussion


Log in to post a comment.