Author: Tim Booth <tbooth@ceh.ac.uk>
Last-Update: Fri, 20 Feb 2015 18:10:56 +0000
Description: More verbose error reporting

--- a/burrito/util.py
+++ b/burrito/util.py
@@ -297,10 +297,15 @@ class CommandLineApplication(Application
             result = \
                 CommandLineAppResult(out, err, exit_status,
                                      result_paths=result_paths)
-        except ApplicationError:
-            result = \
+        except ApplicationError as e1:
+            try:
+              result = \
                 self._handle_app_result_build_failure(out, err, exit_status,
                                                       result_paths)
+            except ApplicationError:
+                #If the handler just throws an error then report the first error,
+                #not the new error.
+                raise e1
 
         # Clean up the input file if one was created
         if remove_tmp:
