From c9d30f3cee1016b806f94c49859332f7e7afa721 Mon Sep 17 00:00:00 2001 From: cramakri <cramakri> Date: Mon, 3 Dec 2012 13:05:35 +0000 Subject: [PATCH] BIS-159 SP-395 : Improved error logging. SVN: 27830 --- .../openBIS/openBIS/CISDOBDetailViewController.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m index e34e36e2279..0b13bcc66a1 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m @@ -267,8 +267,7 @@ if ([CISDOBIpadServiceWillLoginNotification isEqualToString: [note name]]) { [self setStatusText: @"Logging in..."]; } else if ([CISDOBIpadServiceDidLoginNotification isEqualToString: [note name]]) { - NSError* errorOrNil = - [[note userInfo] valueForKey: NSUnderlyingErrorKey]; + NSError* errorOrNil = [[note userInfo] valueForKey: NSUnderlyingErrorKey]; if (errorOrNil) { NSString *description = [[errorOrNil userInfo] valueForKey: NSLocalizedDescriptionKey]; [self setStatusText: description]; @@ -278,7 +277,14 @@ } else if ([CISDOBIpadServiceWillRetrieveRootLevelEntitiesNotification isEqualToString: [note name]]) { [self setStatusText: @"Retrieving root entities..."]; } else if ([CISDOBIpadServiceDidRetrieveRootLevelEntitiesNotification isEqualToString: [note name]]) { - [self clearStatusText]; + NSError* errorOrNil = [[note userInfo] valueForKey: NSUnderlyingErrorKey]; + if (errorOrNil) { + NSString *description = [[errorOrNil userInfo] valueForKey: NSLocalizedDescriptionKey]; + NSString *statusText = [NSString stringWithFormat: @"Could not retrieve entities :%@", description]; + [self setStatusText: statusText]; + } else { + [self clearStatusText]; + } } else if ([CISDOBIpadServiceWillSynchEntitiesNotification isEqualToString: [note name]]) { [self setStatusText: @"Synching entities with cache..."]; } else if ([CISDOBIpadServiceDidSynchEntitiesNotification isEqualToString: [note name]]) { -- GitLab