handling exceptions in jniport

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

handling exceptions in jniport

Tudor Girba-2
Hi Joachim,

As I mentioned in a previous post, all Pharo Exceptions are swallowed during a dispatch from Java. This means that during a callback from Java to Pharo, you also cannot debug.

From the looks of things, I see the issue is here:

JavaCallbackRegistry>>safeDispatch: aRequest to: a2Block
"private -- invoke the handler for aRequest in an environment that will ensure that
some sort of response is always sent back to the requester.  This is *vital* since otherwise
we will almost certainly deadlock ourselves"

[
[[self dispatch: aRequest to: a2Block]
on: JavaException
do: [:err | aRequest notifyError: err]]
on: JNIPortUtility exceptionsWithoutNotifications
do: [:err | aRequest notifyIgnored: 'The Smalltalk handler threw a non-Java exception (', err printString , ')']
] ifCurtailed: [aRequest notifyIgnored: 'The Smalltalk handler did not complete normally'].


Is there no way to allow for some debugging?

At the very least, I would like to suggest to log the exceptions with continuations using Beacon to allow for postmortem debugging. What do you think?

Cheers,
Doru


--

"Every thing has its own flow"