MichaelDrogalis / dire

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

attaching handler to a vector of fns #29

Closed murtaza52 closed 9 years ago

murtaza52 commented 9 years ago

Hi Michael,

I have a bunch of api fn's to which I need to attach the handler.

Below - a and b- are fns.

(def ec2-calls [#'a, #'b ....])

(doseq [call ec2-calls]
  (with-handler! call
    com.amazonaws.AmazonServiceException
    (fn [e & args]
      (throw+ {:msg "Exception while making a call to AWS."
               :aws-fn 'call
               :args (print-str args)
               :error (print-str e)}))))

However I cant get the above to evaluate. Can you help ?

Thanks, Murtaza

MichaelDrogalis commented 9 years ago

Hey there,

With 0.5.3, I ran the following: https://gist.github.com/MichaelDrogalis/698c4468185798e76ee2

Can you ensure that you see the same?

MichaelDrogalis commented 9 years ago

Closing for now. Reopen if you're still stuck.