On Mon, 24 Jan 2011 13:30:49 -0800 (PST) Shantanu Kumar <[email protected]> wrote:
> > > On Jan 25, 2:07 am, dysinger <[email protected]> wrote: > > (try (with-open [x y] ... ) > > (catch Exception)) ;; <- catches any exception from with-open > > macro > > > > I don't think you are correct. > > Maybe this is subjective, but I am rarely interested in knowing what > exception does .close() throw - I would like it ignored. Let me > explain. Catching 'Exception' over with-open does not solve things, > for example: > 1. If the try block returns a value, and .close() raises an > IOException - that breaks my expectation because I am interested in > the try block, not .close(). +1 > 2. If the try block raises exception 'A' and .close() raises exception > B - that changes semantics for me because (a) I might have, for > example, setup transaction-strategy based on the types of exception > thrown, (b) the exception 'A' is lost and I never come to know about > it. +1 > > Regards, > Shantanu > -- Luc P. ================ The rabid Muppet -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
