> On Jul 4, 2014, at 18:33, Lee Skillen <lskil...@vulcanft.com> wrote: > > Hi Andi, > > First of all, absolutely fantastic work on the JCC project, we love it - > Second of all, apologies for contacting you out of the blue via email, but I > wasn't sure of the best place to contact you to ask a few questions > (technical-level, not support-level). If it isn't acceptable to email please > let me know and I can move the discussion somewhere else.
Yes, please include pylucene-dev@lucene.apache.org (subscription required. send mail pylucene-dev-subscribe@ and follow the instructions in the reply). > A bit of background first of all :- > > We've been integrating JCC for the past two weeks on a sizeable > Python/Java/C++ project (where Python is a controller/glue layer) having > migrated from a previous solution to integrate across the languages, and for > the most part JCC has been a lifesaver. > > Technically we've only hit one major issue so far and that has been the > translation of exceptions through the layers. Our Java application does a > lot of double-dispatch (visitation) type of execution and we're calling > outwards to Python to implement the concrete visitation logic. > > In the case of an exception being thrown it results in JCC collating a > traceback and captured exception at every level of scope, resulting in a > giant JavaError exception which has lost it's original PythonException > context. > > I was actually able to fix this by attempting to capture the full context via > PyErr_Fetch() when the first python object is thrown and storing it within > PythonException, and then ensuring that this is carried through each layer > appropriately - This seems to work very well, although admittedly I haven't > considered regressive errors or compatibility yet, but just wanted to > proof-of-concept it first of all then speak with a JCC maintainer. > > The net result is being able to catch errors in a pipeline similar to the > following: > > Python > -> Java > -> Python > -> Raise MyException > <- Throw PythonException (containing MyException) > <- Inject MyException > Catch MyException > > My main questions are to ask your thoughts about :- > > - What are your thoughts about through-layer exceptions and a feature > improvement like this? I agree that losing information during exception throwing is not good. If you've got an improvement in the form of a patch, do not hesitate in sending it in. > - JCC is (I think) currently at home with pylucene, are there are plans to > making it separate? No such plans at the moment. > - Are you happy if I create a public github project and add the patched code > in there for review? You're welcome to fork the code if you'd like but you don't have to if all you want is sending a patch. Your call. Thank you for the kind words ! Andi.. > > Hope to hear from you! > > Cheers, > Lee > > > > TL;DR; > > We would like to :- > > - Improve JCC's through-layer exception support. > - Establish a github project for JCC alone. > > -- > Lee Skillen > > Vulcan Financial Technologies > 1st Floor, 47 Malone Road, Belfast, BT9 6RY > > Office: +44 (0)28 95 817888 > Mobile: +44 (0)78 41 425152 > Web: www.vulcanft.com