MichaelDrogalis / dire

Erlang-style supervisor error handling for Clojure
482 stars 20 forks source link

Added support for multiple exceptions selector. #34

Closed oubiwann closed 8 years ago

oubiwann commented 8 years ago

Addresses issue/request of ticket #33.

Adding support for this feature required a change to the private function selector-type: the check for :key-values was originally vector? and ensuring there were an even number of elements. This would obviously conflict with an even number of exceptions. So I added a third requirement: every other element must be a keyword for it to be a :key-values. This then left room for a new selector type: :class-names which checks if every element of the vector is a class.

To pair with that, I added a new selector-matches? method that checks that the given object is an instance of at least one of the elements in the vector of exception classes.

MichaelDrogalis commented 8 years ago

Thanks! Released under 0.5.4.

oubiwann commented 8 years ago

Sweet!

Just pulled it down ... and updated my code to use it :-)