Exceptions and the distributed object system
Exceptions and the distributed object system
- Subject: Exceptions and the distributed object system
- From: Tim Hart <email@hidden>
- Date: Mon, 16 Jun 2003 11:14:45 -0500
Grrr...
I seem to have encountered a bug in the distributed object system.
Could be minor to some, but it's giving me a real headache...
Here's a verbal description for brevity's sake. I have a whole project
put together to demonstrate, but I'm not sure about the appropriateness
of posting it to the list...
The following code works correctly - MyException is caught.
Assume:
MyException subclasses NSException
[ MyClass foo ] raises MyException.
myClass is an instance of MyClass *in the same process*
//code snippet - typed in mail, usual disclaimers...
NS_DURING
[ myClass foo ];
//..normal processing
NS_HANDLER
if( [ localException isKindOfClass:[ MyException class ] ] )
{
//this is where the code ends up if myClass is in process
}
else
{
//this is where the code ends up of myClass is an NSDistantObject and
is a proxy for an object in another process
//the name and reason attributes are preserved. [ localException class
] returns NSException
}
NS_ENDHANDLER
Here's what I would consider a bug:
if myClass is a DistantObject, representing an instance of MyClass
running in a different process ( haven't tested different thread ),
then the class of the exception caught is NSException, even though
MyException was thrown. The name and reason attributes are preserved.
I've tried overriding 'classForPortCoder' and
'replacementObjectForPortCoder', and implementing NSCoding with no
luck. My best guess is that the issue is somewhere in
NSDistantObjectRequests' 'replyWithException' method, but I'd rather
hear some other suggestions/opinions before I start trying to muck with
replacing system calls.
I realize it's not traditional to subclass NSException. I'm sure
philosophical discussions could continue forever. From my perspective,
the technical language implementation supports it within a process, so
it should across processes.
Discussion?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.