scgilardi/slingshot — pull request #47 by scgilardi (2014-10-04 04:31:15+00:00)
Title: Issue 35

`throw+` uses `ex-info` to convey data to be caught by `try+` `catch` clauses. The code in this pull request treats the map contained in *any* caught `ex-info` object as if it were a map thrown by throw+. This includes the automatic unwrapping of cause chains to find the underlying `ex-info` object.

This is a breaking change for any code that formerly caught instances of `clojure.lang.IExceptionInfo` (including `clojure.lang.ExceptionInfo`). Objects that implement `IExceptionInfo` are no longer catchable by try+ catch clauses. Instead the map they contain is considered to be the catchable object and any `selectors` are applied to the map rather than the `IExceptionInfo` object itself.

The rationale is that it's much more convenient and useful for catch clauses to operate on the thrown map.

While the `IExceptionInfo` wrapper itself is likely of little interest, it is still available within a catch clause as `(:wrapper &throwContext)`.