Re: Error reporting in Cocoa (was Re: Exception not being caught)
Re: Error reporting in Cocoa (was Re: Exception not being caught)
- Subject: Re: Error reporting in Cocoa (was Re: Exception not being caught)
- From: "A.M." <email@hidden>
- Date: Tue, 22 Mar 2011 11:07:57 -0400
On Mar 21, 2011, at 10:24 PM, Chris Hanson wrote:
> Ultimately, the solution will be to modify HessianKit -- or any other framework that presents an RPC-style interface[1] -- to follow the Cocoa convention of returning BOOL (or a non-nil/nil object reference) to indicate success or failure, and to fill in an NSError passed by reference if the caller desires additional failure details.
>
> -- Chris
>
> [1] Distributed Objects doesn’t work this way - it predates NSError and uses exceptions, which results in exactly the problems discussed in this thread. Often DO calls will wind up wrapped in an API that just does a @try/@catch around the call and returns success/failure, for exactly this reason.
Hi Chris,
I am curious as to how you would propose to add error: handlers to DO calls considering that DO is meant to transparent and cannot modify method signatures. For example, assuming you were designing a new DO framework, how would you propose changing this:
int junk = [secretlyDistantObject calculate:4];
to allow for a socket timeout? Would you then wrap any API which could be potentially called by DO with the additional error: argument?
Cheers,
M_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden