On Thu, Jun 18, 2009 at 7:49 PM, Andi Vajda<va...@apache.org> wrote:
> Instead, I fixed half of bug PYLUCENE-1 [1] by including the stacktrace of a
> Java exception into the string representation of the Python error object
> wrapping it. When a JavaError is reported, the corresponding java stacktrace
> is now included in the error message.

This is useful!

What about not aborting in case of findClass exception, but just
printing the the class name and the exception? (see attachment).

In HtmlUnit there are two classes that raise an exception, but I do
not care about them working (and the --exclude parameter has no effect
on findClass...)

Thanks,
Ludovico
Index: jcc/cpp.py
===================================================================
--- jcc/cpp.py	(revision 805919)
+++ jcc/cpp.py	(working copy)
@@ -389,7 +389,14 @@
                     shared, compiler, modules, wininst)
     else:
         for className in classNames:
-            cls = findClass(className.replace('.', '/'))
+            try:
+                cls = findClass(className.replace('.', '/'))
+            except JavaError:
+                import traceback
+                print "Error finding class", className
+                traceback.print_exc()
+                continue
+
             if cls is None:
                 raise ValueError, className
             if cls in excludes:

Reply via email to