Simple Exception Handling
Simple Exception Handling
- Subject: Simple Exception Handling
- From: "Frederick C. Lee" <email@hidden>
- Date: Thu, 18 Apr 2002 16:49:01 -0700
Greetings:
I'm trying to create a simple exception handler that merely
displays an Alert when an Exception is raised. I'm using the standard
format:
- (double)ComputeResult :(long)sourceValue :(NSString *)sUnit :(NSString
*)tUnit {
NS_DURING {
// Process Data Here.
}
NS_HANDLER {
NSRunAlertPanel(@"Error Panel", @"%@", @"OK", nil, nil,
localException);
}
NS_ENDHANDLER;
return(0);
} // end ComputeResult
What I get is the following:
2002-04-18 16:25:40.278 Converter[798] *** Exception handlers were not
properly removed. Some code has jumped or returned out of an
NS_DURING...NS_HANDLER region without using the NS_VOIDRETURN or
NS_VALUERETURN macros.
Converter.app has exited due to signal 4 (SIGILL).
----------
Apple's docs say that I don't need to explicitly RETURN, that by
default, processing continues beyond the Exception-Handling block. In
this case, return(0) for the function.
How do I "properly remove" exceptions?
What am I doing wrong?
Thanks.
Ric.
_______________________________________________
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.