MichaelDrogalis/dire — pull request #19 by johnworth (2013-10-31 16:35:02+00:00)
Title: Changed (throw) to (throw+) in (default-error-handler)

I ran into the following stacktrace when some code I wrote triggered (dire.core/default-error-handler):

```
java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Throwable
at dire.core$default_error_handler.doInvoke(core.clj:136)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:619)
at dire.core$fn__8874.invoke(core.clj:159)
at clojure.lang.MultiFn.invoke(MultiFn.java:236)
at dire.core$supervised_meta.doInvoke(core.clj:184)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$partial$fn__4190.doInvoke(core.clj:2396)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at robert.hooke$compose_hooks$fn__8723.doInvoke(hooke.clj:40)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:617)
at robert.hooke$run_hooks.invoke(hooke.clj:46)
at robert.hooke$prepare_for_hooks$fn__8728$fn__8729.doInvoke(hooke.clj:54)
```

It looks like (default-error-handler) is calling (throw) which doesn't like the Slingshot error map that was getting passed to it. I changed (throw) to (throw+) and the above exception no longer gets raised.

I had a difficult time writing unit tests that triggered (default-error-handler) indirectly, so I resorted to Midje's (testable-privates) feature to call (default-error-handler) directly. My apologies if that's a problem.
With the unit tests, I was able to verify that the above stacktrace was raised before the fix and is no longer present afterwards.