rschreijer/lutung — pull request #23 by bcolyn (2014-01-30 14:58:49+00:00)
Title: Fix for lutung #22 + MandrillApiError

As explained here (https://github.com/rschreijer/lutung/issues/22) the inclusion of log4j.xml in main resources rather than test resources is problematic. First commit moves that file out of the way.

Second commit is another issue i had today. If one wants to catch all exceptions that should be caught (for instance, to wrap them, translate to a REST HTTP Status, ...) one could write catch(Exception ex) - but that does not catch the MandrillApiError, which descends now from Throwable. Catching Throwable however is dangerous and should not normally be done because this also catches java.lang.Error and its descendants.

http://docs.oracle.com/javase/7/docs/api/java/lang/Error.html
"An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions."

Long story short - the problem is MandrilApiError's place in the exception hierarchy - MandrillApiError should descend from Exception (or perhaps IOException).