Hi On Wed, Nov 26, 2008 at 6:27 AM, Chris Turner <[EMAIL PROTECTED]> wrote: > > On Nov 24, 7:38 am, "Michael Wood" <[EMAIL PROTECTED]> wrote: >> On Mon, Nov 24, 2008 at 4:45 PM, Stuart Sierra >> >> <[EMAIL PROTECTED]> wrote: >> >> > If you're running this at the REPL, in recent versions only the name >> > of the exception is printed. If you want the full backtrace, do: >> > (.printStackTrace *e) >> >> That doesn't explain why the line number is listed as 0. >> >> Is that expected? [...] > The reason the line number is 0 is the NPE happens in the REPL... (new- > listener 8888) is not throwing the exception, it's just returning > null. The NPE happens on the next line: (.accept listener) where > listener is now set to null.
I still don't see why it's line 0 :) I realise that (new-listener) has nothing to do with it really and that it is the null pointer dereference that causes this, but surely it is not on NO_SOURCE_FILE:0. If this is expected on the REPL for some reason, then take a look at Timothy's original message in this thread. He was loading it from test.clj and the exception was reported on test.clj:0. On a related note, if I try to evaluate a nonexistent symbol at the REPL it always seems to report it as line 0, whereas if I try to evaluate a nonexistent function it is reported correctly: $ clj Clojure user=> blah java.lang.Exception: Unable to resolve symbol: blah in this context (NO_SOURCE_FILE:0) user=> blah java.lang.Exception: Unable to resolve symbol: blah in this context (NO_SOURCE_FILE:0) user=> blah java.lang.Exception: Unable to resolve symbol: blah in this context (NO_SOURCE_FILE:0) user=> (blah) java.lang.Exception: Unable to resolve symbol: blah in this context (NO_SOURCE_FILE:4) user=> This is with r1121. -- Michael Wood <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---