andre 2 лет назад
Родитель
Сommit
e4754167ca
1 измененных файлов с 33 добавлено и 0 удалено
  1. 33 0
      app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

+ 33 - 0
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -66,8 +66,41 @@ class EditAccountDataProvider extends BaseDataProvider
 
         try {
             $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
+        try {
             $domainID = $api->getDomainId($this->getWhmcsParamByKey('customfields')['maildomain']);
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
+        try {
             $account = $api->getUsers($fields,$domainID,$cond);
+        } catch (KerioApiException $error) {
+            logModuleCall(
+                'kerioEmail',
+                __FUNCTION__,
+                $error,
+                'Debug Error',
+                $error->getMessage()
+            );
+            return ['error' => $error->getMessage()];
+        }
+        try {
             $address = $api->getAddress($this->actionElementId);
         } catch (KerioApiException $error) {
             logModuleCall(