URL:
<http://savannah.gnu.org/bugs/?23314>
Summary: Problem handling exceptions with own handler
Project: GNUstep
Submitted by: uboss
Submitted on: Wednesday 05/21/2008 at 12:04
Category: Base/Foundation
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
When instaled own handler
static void myExceptionHandler (NSException *exception)
{
FILE *fw;
NSLog (@"Osetruji exception ...\n%@", exception);
fw = fopen ("exception.err", "a");
fprintf (fw, [[NSString stringWithFormat:@"%@ -> ERROR:[EMAIL PROTECTED]",
[NSDate
date], exception] cString]);
fclose (fw);
abort ();
}
with
NSSetUncaughtExceptionHandler(&myExceptionHandler);
or
_NSUncaughtExceptionHandler = myExceptionHandler;
and then call
[NSException raise:NSInternalInconsistencyException
format:@"TEST TEST TEST"];
the handler myExceptionHandler is not called,
insted of message
Osetruji exception ...
<NSException: 0x8540070> NAME:NSInternalInconsistencyException REASON:TEST
TEST TEST INFO:(nil)
Abort (core dumped)
I got mesasge
Problem posting notification: <NSException: 0
x85400f0> NAME:NSInternalInconsistencyException REASON:TEST TEST TEST
INFO:(nil)
it has something to do with NSNotificationCeneter.m _postAndRelease method
...
if (o->next != 0)
{
NS_DURING
{
(*o->method)(o->observer, o->selector, notification);
}
NS_HANDLER
{
NSLog(@"Problem posting notification: %@", localException);
}
NS_ENDHANDLER
...
when removed NS_DURING and NS_HANDLER ... NS_ENDHANDLER
the handler myExceptionHandler is called again.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?23314>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnustep