[pylucene-dev] Python exception not always generated for Java RuntimeException
Andi Vajda
vajda at osafoundation.org
Thu Nov 6 16:58:46 PST 2008
On Thu, 6 Nov 2008, Aaron Lav wrote:
> On Tue, Nov 04, 2008 at 01:25:10PM -0500, Aaron Lav wrote:
>> On Tue, Nov 04, 2008 at 10:02:22AM -0800, Andi Vajda wrote:
>>> >>> DateField.dateToString(Date(0,1,1))
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> lucene.JavaError: java.lang.RuntimeException: time '-2206281600000' is
>>> too early, must be >= 0
>>
>> That's what I was expecting: I'll try to dig further to see what's wrong
>> with my build environment that gives me the SystemError.
>
> I suspect the difference is that I was building in non-shared mode.
>
> The underlying code is in JCCEnv::reportException()
>
> if (vm_env->IsSameObject(cls, _thr))
> throw pythonError(throwable);
>
> and above, if _jcc_lib isn't defined:
>
> _thr = (jclass) vm_env->NewGlobalRef(vm_env->FindClass("java/lang/RuntimeException"));
>
> and then macros.h returns NULL when it catches a pythonError.
>
> Andi, I presume you're building with shared? I'll try that, but it might
> be nice to clear this up for non-shared builds.
Ahhh, I understand now. I can't just assume that all RuntimeError instances
are python errors. That's the problem.
Andi..
More information about the pylucene-dev
mailing list