Closed gfredericks closed 10 years ago
Thanks for the suggestion. I'm sorry it took so long for me to reply. I like the idea. I did an implementation in https://github.com/scgilardi/slingshot/pull/47 . I'd appreciate hearing any thoughts you have if you're willing to review it.
This looks good, thanks!
In the interim I've been using catch-data which I think ended up being a lot simpler since it didn't have to support older versions of Clojure.
you're welcome! catch-data looks nice. closing this issue along with the merge of #47.
I found myself wishing I could use slingshot only at the catch site -- i.e., do something like:
and then somewhere else:
I'm inclined to this usage because ex-info feels like the more idiomatic thing to do, but I don't think there's any easy way (without slingshot) to catch ExceptionInfo based on the data.
Based on some cursory repl-play, I would think this should be possible to support in a backwards compatible way by applying the selectors to the
:object
if the ExceptionInfo was thrown bythrow+
(as detected by the metadata) or to the top-level map otherwise.If this seems reasonable I'd be happy to take a stab at it myself.