oc-sogo: pretty print Exceptions in sogo_backend_handle_objc_exception()

Now we have a nice stack trace printed out from [NSException callStackSymbols]

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
This commit is contained in:
Kamen Mazdrashki 2014-03-20 17:26:44 +01:00 committed by Julio García
parent bcfb674cd1
commit fc9dc08045

View file

@ -74,8 +74,13 @@ sogo_backend_unexpected_error()
static enum mapistore_error static enum mapistore_error
sogo_backend_handle_objc_exception(NSException *e, const char *fn_name, const int line_no) sogo_backend_handle_objc_exception(NSException *e, const char *fn_name, const int line_no)
{ {
NSLog(@"[SOGo: %s:%d] - EXCEPTION: %@, reason: %@, backtrace: %@", NSString *callStackSymbols = nil;
fn_name, line_no, [e name], [e reason], [e callStackSymbols]); if ([e respondsToSelector:@selector(callStackSymbols)])
{
callStackSymbols = [[e callStackSymbols] componentsJoinedByString:@"\n\t"];
}
NSLog(@"[SOGo: %s:%d] - EXCEPTION: %@, reason: %@, backtrace: \n\t%@\n",
fn_name, line_no, [e name], [e reason], callStackSymbols);
// Another point of view on the stack trace // Another point of view on the stack trace
{ {