andre 1 год назад
Родитель
Сommit
0428f0fa6a
1 измененных файлов с 32 добавлено и 2 удалено
  1. 32 2
      app/Libs/Zimbra/Components/Api/Soap/MySoapClient.php

+ 32 - 2
app/Libs/Zimbra/Components/Api/Soap/MySoapClient.php

@@ -44,12 +44,42 @@ class MySoapClient extends SoapClient
             time()
         );
 
-        $response = parent::__doRequest($request, $location, $action, $version);
+        $exception = null;
 
+        try {
+        
+            $response = parent::__doRequest($request, $location, $action, $version);
+        
+        }
+        
+        catch (SoapFault $sf) {
+        
+            //this code was not reached    
+        
+            $exception = $sf;
+        
+        }
+        
+        catch (Exception $e) {
+        
+            //nor was this code reached either
+        
+            $exception = $e;
+        
+        }
+        
+        if((isset($this->__soap_fault)) && ($this->__soap_fault != null)) {
+        
+            //this is where the exception from __doRequest is stored
+        
+            $exception = $this->__soap_fault;
+        
+        }
+        
         logModuleCall(
             'zimbraEmail',
             __FUNCTION__,
-            $response,
+            $exception,
             "Debug: response",
             time()
         );