Re: Plugin authors: change in error handling
- From:
- Sean Corfield
- Date:
- 2012-08-07 @ 00:45
On Mon, Aug 6, 2012 at 4:36 PM, Phil Hagelberg <phil@hagelb.org> wrote:
> In Leiningen 2.x, tasks should call the `leiningen.core.main/abort`
> function when a fatal error is encountered. If the
> `leiningen.core.main/*exit-process?*` var is bound to true, then this
> will trigger an exit, but in some contexts (like `with-profiles`) it
> will simply trigger an exception and go on to the next task.
FWIW, lein-expectations was updated this morning - to 0.0.7 - to
include what I hope is a fix for this change. It now calls abort if
there any failures / errors in tests. However, it's still not clear
how multi-version testing will be affected by this. Specifically:
* in a multi-version test for, say, Clojure 1.2, 1.3, 1.4
* if a test fails against 1.2 and the plugin calls abort
* testing seems to proceed to 1.3 and 1.4 (which may pass)
* will Leiningen exit with a status code of 1 at that point (because
one task failed) or 0?
This is important for running multi-version testing in build scripts.
If abort simply causes Leiningen to print a warning and move on to the
next task, but later exit with a zero status code, then this forces
testing plugins to re-bind *exit-process?* to true before they call
abort which is kinda ugly (and prevents multi-version testing from
running later version tests if an early version test fails).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)