changcheng / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

Runner: exceptions are caught & logged, but, should exit with System.exit(1) so Ant and other CLI interfaces know there was an error #334

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a test JS file with syntax errors and place into a wro.xml group
2. Execute wro4j runner from an Ant build (using <exec>), specifying jsHint 
processor

What is the expected output? 
1. The ant-build should fail (when any processor/compressor encounters an 
exception)

What do you see instead?
1. runner 'completes' successfully without error, Ant does not 'see' the error

Misc:
I manually patched this in a few places, but really, the Exceptions that are 
caught need to use System.exit(1) so that Ant tasks can fail when a 
processor/compressor fails.

Original issue reported on code.google.com by fastforw...@gmail.com on 16 Nov 2011 at 5:56

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 16 Nov 2011 at 6:22

GoogleCodeExporter commented 9 years ago
I can send a diff of the places this needed to happen. There was the runner and 
also a class in core. I can't recall off the top of my head. Let me know if 
you'd like a diff.

Original comment by fastforw...@gmail.com on 17 Nov 2011 at 12:55

GoogleCodeExporter commented 9 years ago
Yes, please.

caught & logged, but, should exit with System.exit(1) so Ant and other CLI
interfaces know there was an error

runner and also a class in core. I can't recall off the top of my head. Let
me know if you'd like a diff.

Original comment by alex.obj...@gmail.com on 17 Nov 2011 at 6:41

GoogleCodeExporter commented 9 years ago
Here is a patch for the runner System.exit() issue

Original comment by fastforw...@gmail.com on 17 Nov 2011 at 8:23

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I'll use your patch for the next release.

Original comment by alex.obj...@gmail.com on 21 Nov 2011 at 8:53

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 21 Nov 2011 at 9:29