andre 5 ماه پیش
والد
کامیت
41913c4915
2فایلهای تغییر یافته به همراه3 افزوده شده و 31 حذف شده
  1. 0 28
      api/class/KerioApi.php
  2. 3 3
      core/Traits/ErrorCodesLibrary.php

+ 0 - 28
api/class/KerioApi.php

@@ -533,15 +533,6 @@ class KerioApi implements KerioApiInterface {
 
 
 		/* Handle errors */
 		/* Handle errors */
 		if (isset($response['error'])) {
 		if (isset($response['error'])) {
-
-			logModuleCall(
-                'kerioEmail',
-                __FUNCTION__,
-                $rawResponse,
-                'Debug Error1',
-                $response
-            );
-
 			if (FALSE === empty($response['error'])) {
 			if (FALSE === empty($response['error'])) {
 				$message	= $response['error']['message'];
 				$message	= $response['error']['message'];
 				$code		= $response['error']['code'];
 				$code		= $response['error']['code'];
@@ -549,33 +540,14 @@ class KerioApi implements KerioApiInterface {
 					? $response['error']['data']['messageParameters']['positionalParameters']
 					? $response['error']['data']['messageParameters']['positionalParameters']
 					: '';
 					: '';
 				throw new KerioApiException($message, $code, $params, $data, $body);
 				throw new KerioApiException($message, $code, $params, $data, $body);
-			} else {
-				$message = 'unkown error';
-				$code = '0';
-				$params = '';
-				throw new KerioApiException($message, $code, $params, $data, $body);
 			}
 			}
 		}
 		}
 		elseif (isset($response['result']['errors'])) {
 		elseif (isset($response['result']['errors'])) {
-
-			logModuleCall(
-                'kerioEmail',
-                __FUNCTION__,
-                $rawResponse,
-                'Debug Error2',
-                $response
-            );
-
 			if (FALSE === empty($response['result']['errors'])) {
 			if (FALSE === empty($response['result']['errors'])) {
 				$message	= $response['result']['errors'][0]['message'];
 				$message	= $response['result']['errors'][0]['message'];
 				$code		= $response['result']['errors'][0]['code'];
 				$code		= $response['result']['errors'][0]['code'];
 				$params		= $response['result']['errors'][0]['messageParameters']['positionalParameters'];
 				$params		= $response['result']['errors'][0]['messageParameters']['positionalParameters'];
 				throw new KerioApiException($message, $code, $params, $data, $body);
 				throw new KerioApiException($message, $code, $params, $data, $body);
-			} else {
-				$message = 'unkown error';
-				$code = '0';
-				$params = '';
-				throw new KerioApiException($message, $code, $params, $data, $body);
 			}
 			}
 		}
 		}
 
 

+ 3 - 3
core/Traits/ErrorCodesLibrary.php

@@ -34,11 +34,11 @@ trait ErrorCodesLibrary
     {
     {
         $this->loadErrorCodes();
         $this->loadErrorCodes();
 
 
-        if ($this->errorCodesAppHandler->errorCodeExists($code[ErrorCodes::CODE]))
+        if ($this->errorCodesAppHandler->errorCodeExists($code))
         {
         {
-            return $this->errorCodesAppHandler->getErrorMessageByCode($code[ErrorCodes::CODE]);
+            return $this->errorCodesAppHandler->getErrorMessageByCode($code);
         }
         }
        
        
-        return $this->errorCodesCoreHandler->getErrorMessageByCode($code[ErrorCodes::CODE]);
+        return $this->errorCodesCoreHandler->getErrorMessageByCode($code);
     }
     }
 }
 }