mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Improve logging of an exception when posting a notification so that, if possible, we include the details of the notification being posted.
This commit is contained in:
parent
feac65a23f
commit
2b840550f0
1 changed files with 16 additions and 1 deletions
|
@ -1200,7 +1200,22 @@ static NSNotificationCenter *default_center = nil;
|
|||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Problem posting notification: %@", localException);
|
||||
BOOL logged;
|
||||
|
||||
/* Try to report the notification along with the exception,
|
||||
* but if there's a problem with the notification itself,
|
||||
* we just log the exception.
|
||||
*/
|
||||
NS_DURING
|
||||
NSLog(@"Problem posting %@: %@", notification, localException);
|
||||
logged = YES;
|
||||
NS_HANDLER
|
||||
logged = NO;
|
||||
NS_ENDHANDLER
|
||||
if (NO == logged)
|
||||
{
|
||||
NSLog(@"Problem posting notification: %@", localException);
|
||||
}
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue