From c3aeb3ce1d4e73c8383d6bc9c8827d9ef8eb7335 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Tue, 15 Jan 2013 12:37:01 +0000
Subject: [PATCH] BIS-159 SP-442 : Show status messages when operations fail

SVN: 28104
---
 .../openBIS/CISDOBDetailViewController.m       | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m
index 1cc520e10d9..b7d2f120259 100644
--- a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m
+++ b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m
@@ -337,11 +337,25 @@
     } else if ([CISDOBIpadServiceWillDrillOnEntityNotification isEqualToString: [note name]]) {
         [self setStatusText: @"Retrieving drill information..."];
     } else if ([CISDOBIpadServiceDidDrillOnEntityNotification 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 drill :%@", description];
+            [self setStatusText: statusText];
+        } else {
+            [self clearStatusText];
+        }
     } else if ([CISDOBIpadServiceWillRetrieveDetailsForEntityNotification isEqualToString: [note name]]) {
         [self setStatusText: @"Retrieving detail information..."];
     } else if ([CISDOBIpadServiceDidRetrieveDetailsForEntityNotification 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 details :%@", description];
+            [self setStatusText: statusText];
+        } else {
+            [self clearStatusText];
+        }
     }    
 }
 
-- 
GitLab