OK, I created PYLUCENE-1, yay!:

    https://issues.apache.org/jira/browse/PYLUCENE-1

Andi can you go add some components to the Jira instance?

Mike

Andi Vajda wrote:


On Fri, 13 Mar 2009, Michael McCandless wrote:

OK it's great that I can .printStackTrace() to see it...

But shouldn't we override JavaError.__str__ so by default an unhandled exception originating from Java would reveal its Java trace as well? (And presumably vice/versa).

Does that actually work or does it require some deeper messing with Python so that the exception reporting explores the actual Java exception and continues reporting the stacktrace ?

I think on exception we should try to provide as much info as possible to aid in debugging. Sometimes, it's a user who sees this exception, copies it into email and sends it off to you for remote debugging.

Oh, in theory, I completely agree with you. Last time I looked at implementing this it wasn't trivial. Maybe, I missed the obvious ?

Even if overriding __str__ thus worked here, Java is not making it trivial to get a stacktrace as a String (you have to have PrintWriter and StringWriter available to you). Similarly, the JNI ExceptionDescribe() C++ function prints to stderr, it doesn't give you a string.

So, what needs to be done instead is bend Python to do the right thing when reporting the stacktrace of the JavaError python exception and that looked non-trivial last time I looked into it.

Andi..


Mike

Andi Vajda wrote:

On Fri, 13 Mar 2009, Michael McCandless wrote:
* When I hit an exception in Java, the carryover to Python fails to
include the full stack trace (sources & line numbers) from Java,
which makes debugging harder.  Is that normal?
That's right and documented here [1].
Andi..
[1] http://lucene.apache.org/pylucene/jcc/documentation/readme.html#exceptions

Reply via email to