Checked exceptions in LazySeq

1 view
Skip to first unread message

David Powell

unread,
Nov 19, 2009, 7:42:54 AM11/19/09
to clo...@googlegroups.com

LazySeq is wrapping my InterruptedExceptions in several layers of RuntimeException, which is a
bit awkward, because then my top level code spews pages of exceptions, rather than just reporting
that the process was cancelled.

Is there anything better that could be done?

+ Change the interface to just throw Exception?

+ Have a special subclass of RuntimeException, eg RuntimeWrapperException, so that they can be
more easily identified and peeled off by the catcher?

Hmm - maybe java.lang.reflect.UndeclaredThrowableException would do?

--
Dave

Meikel Brandmeyer

unread,
Nov 19, 2009, 8:16:23 AM11/19/09
to Clojure
Hi,
You could build your exceptions on clojure.contrib.condition. Then
just peel off the RuntimeExceptions until you reach the Condition. If
there is none, proceed as before...

Sincerely
Meikel
Reply all
Reply to author
Forward
0 new messages