andre hai 5 meses
pai
achega
41913c4915
Modificáronse 2 ficheiros con 3 adicións e 31 borrados
  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 */
 		if (isset($response['error'])) {
-
-			logModuleCall(
-                'kerioEmail',
-                __FUNCTION__,
-                $rawResponse,
-                'Debug Error1',
-                $response
-            );
-
 			if (FALSE === empty($response['error'])) {
 				$message	= $response['error']['message'];
 				$code		= $response['error']['code'];
@@ -549,33 +540,14 @@ class KerioApi implements KerioApiInterface {
 					? $response['error']['data']['messageParameters']['positionalParameters']
 					: '';
 				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'])) {
-
-			logModuleCall(
-                'kerioEmail',
-                __FUNCTION__,
-                $rawResponse,
-                'Debug Error2',
-                $response
-            );
-
 			if (FALSE === empty($response['result']['errors'])) {
 				$message	= $response['result']['errors'][0]['message'];
 				$code		= $response['result']['errors'][0]['code'];
 				$params		= $response['result']['errors'][0]['messageParameters']['positionalParameters'];
 				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();
 
-        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);
     }
 }