Better debug

This commit is contained in:
Michael RICOIS 2017-04-13 14:23:16 +02:00
parent ef3842021f
commit 00b22c28e5

View File

@ -147,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
}
$methodConfig = $this->config[$name];
$this->logger->info(print_r($methodConfig,1));
// --- Cache
$cacheEnable = false;
if ( array_key_exists('cache', $methodConfig) ) {
@ -172,22 +172,22 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->info(__CLASS__.'->'.$name);
$this->logger->info(print_r($arguments,1));
$this->logger->info(__CLASS__.'->'.$name.':'.print_r($arguments,1));
}
try {
$response = parent::__call($name, $arguments);
// Response vide
// --- Response vide
if ($response == '') {
$this->logger->error("$name : ".print_r($arguments, 1));
$this->logger->error(__CLASS__.'->'.$name.':'.print_r($arguments, 1));
return false;
}
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->info(print_r($response,1));
$this->logger->info(__CLASS__.'->'.$name.':'.print_r($response,1));
}
// --- Cache
@ -201,13 +201,13 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->error($fault->faultcode.' - '.$fault->faultstring);
$this->logger->error(__CLASS__.'->'.$name.':'.$fault->faultcode.' - '.$fault->faultstring);
}
// --- Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
$this->logger->info("Exception as error message : ".$fault->faultcode);
$this->logger->info(__CLASS__.'->'.$name.':'." Exception as error message : ".$fault->faultcode);
throw new Exception($fault->faultstring);
}
}