Re: Lazy Exceptions

2009-08-28 Thread B Smith-Mannschott
On Fri, Aug 28, 2009 at 16:57, John Harrop wrote: > On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: >> >> On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: >> > >> > Well, I can see that LazySeq does indeed catch and wrap all Exceptions >> > in a RuntimeException.  I also think I can work ar

Re: Lazy Exceptions

2009-08-28 Thread Rich Hickey
On Fri, Aug 28, 2009 at 10:57 AM, John Harrop wrote: > On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: >> >> On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: >> > >> > Well, I can see that LazySeq does indeed catch and wrap all Exceptions >> > in a RuntimeException.  I also think I can work

Re: Lazy Exceptions

2009-08-28 Thread John Harrop
On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: > > On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: > > > > Well, I can see that LazySeq does indeed catch and wrap all Exceptions > > in a RuntimeException. I also think I can work around it, but I'd > > like to know why this was done? > >

Re: Lazy Exceptions

2009-08-28 Thread Rich Hickey
On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: > > Well, I can see that LazySeq does indeed catch and wrap all Exceptions > in a RuntimeException.  I also think I can work around it, but I'd > like to know why this was done? > > Was it necessary given the checked vs. unchecked exception system

Re: Lazy Exceptions

2009-08-28 Thread Meikel Brandmeyer
Hi, On Aug 28, 6:07 am, eyeris wrote: > When you say "the original" do you mean the outer-most > RuntimeException or the inner-most exception? It think I meant the outer-most exception. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because y

Re: Lazy Exceptions

2009-08-27 Thread eyeris
When you say "the original" do you mean the outer-most RuntimeException or the inner-most exception? On Aug 27, 8:33 am, Meikel Brandmeyer wrote: > Hi, > > On Aug 27, 5:47 am, Tim Snyder wrote: > > > > > I'm trying to understand how laziness affects exception handling.  I > > keep finding my e

Re: Lazy Exceptions

2009-08-27 Thread Tim Snyder
Well, I can see that LazySeq does indeed catch and wrap all Exceptions in a RuntimeException. I also think I can work around it, but I'd like to know why this was done? Was it necessary given the checked vs. unchecked exception system of Java? Is it because the exception generated by a lazy seq

Re: Lazy Exceptions

2009-08-27 Thread Nik Kolev
Apache's commons-lang library has a utility class that has a decent amount of functionality for dissecting exception stacks/traces (getRootCause() maybe what you want): http://commons.apache.org/lang/api/org/apache/commons/lang/exception/ExceptionUtils.html On Thu, Aug 27, 2009 at 10:03 AM, Tim Sny

Re: Lazy Exceptions

2009-08-27 Thread Tim Snyder
Thanks for the replies. I'll have a look at the impl. of LazySeq tonight and see if that helps. It sounds like it shouldn't be a problem to work around though. Is there somewhere I can read that gives an explanation or information about why this is done? On Aug 27, 9:33 am, Meikel Brandmeyer

Re: Lazy Exceptions

2009-08-27 Thread Meikel Brandmeyer
Hi, On Aug 27, 5:47 am, Tim Snyder wrote: > I'm trying to understand how laziness affects exception handling.  I > keep finding my exceptions wrapped in RuntimeExceptions. > > If I have code that just throws an exception, I get what I'd expect: > (throw (Exception. "Plain Exception")) --> > Plai

Re: Lazy Exceptions

2009-08-27 Thread Dan Fichter
Lazy seqs were designed to work that way. See the implementation in clojure.lang.LazySeq. RuntimeExceptions get thrown whenever Exceptions are caught. I guess you find it unhelpful? Dan On Wed, Aug 26, 2009 at 11:47 PM, Tim Snyder wrote: > > I'm trying to understand how laziness affects exce

Lazy Exceptions

2009-08-27 Thread Tim Snyder
I'm trying to understand how laziness affects exception handling. I keep finding my exceptions wrapped in RuntimeExceptions. If I have code that just throws an exception, I get what I'd expect: (throw (Exception. "Plain Exception")) --> Plain Exception [thrown class java.lang.Exception] On the