Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error handling for sync invocations in Java
26-11-2011, 04:55 PM
Post: #1
Error handling for sync invocations in Java
The generated code for Java proxies seems to treat errors differently for sync and async calls. For sync calls, there is code like this:

sync.waitToComplete();
try
{
sync.reportError();
}
catch (ProxyError pe) { }
return sync.getSearchCaps();

and for async calls, there is code like this:

if (Invocation.error(aAsyncHandle))
{
throw new ProxyError();
}
int index = 0;
String searchCaps = Invocation.getOutputString(aAsyncHandle, index++);
return searchCaps;

It appears that the async code throws a ProxyError back to user code if an error occurs in the invocation, but the sync code checks for an invocation error and catches and ignores the thrown exception.

I looked at the C# code and this seems to throw errors back to user code in both the sync and async cases.

Is my impression as stated above correct? If so, is there some reason why the sync code for Java doesn't report invocation errors back to user code?

Simon
Find all posts by this user


Messages In This Thread
Error handling for sync invocations in Java - simoncn - 26-11-2011 04:55 PM

Forum Jump: