• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple Exception Handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Exception Handling


  • Subject: Re: Simple Exception Handling
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 19 Apr 2002 12:54:24 +0200

On Friday, April 19, 2002, at 01:49 , Frederick C. Lee wrote:

- (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.

I am afraid the problem would be elsewhere -- I see no reason in the posted code. Expecially, this

NS_DURING
// this IS a block, you don't need extra {...}
[NSException raise:@"Foo" format:@"bar"];
NS_HANDLER
// ditto
NSRunAlertPanel(@"Ick!",@"%@",nil,nil,nil,localException);
NS_ENDHANDLER

provably works without any problem at all (I've checked just now to be sure whether NSRunAlertPanel does not happen to do some dirty trick which would clash with the exception system).
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
References: 
 >Simple Exception Handling (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Re: NSBitmapImageRep problem (I think)
  • Next by Date: Re: NSBitmapImageRep problem (I think)
  • Previous by thread: Simple Exception Handling
  • Next by thread: Re: Simple Exception Handling
  • Index(es):
    • Date
    • Thread