mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-29 08:36:05 +03:00
add date in log: system/library/retailcrm/RetailcrmProxy.php
This commit is contained in:
parent
707a3a1783
commit
eb1d80304e
@ -20,22 +20,23 @@ class RetailcrmProxy
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$response = call_user_func_array(array($this->api, $method), $arguments);
|
$response = call_user_func_array(array($this->api, $method), $arguments);
|
||||||
|
$date = date('[Y-m-d H:i:s]');
|
||||||
|
|
||||||
if (!$response->isSuccessful()) {
|
if (!$response->isSuccessful()) {
|
||||||
error_log("[$method] " . $response->getErrorMsg() . "\n", 3, $this->log);
|
error_log($date . " [$method] " . $response->getErrorMsg() . "\n", 3, $this->log);
|
||||||
if (isset($response['errors'])) {
|
if (isset($response['errors'])) {
|
||||||
$error = implode("\n", $response['errors']);
|
$error = implode("\n", $response['errors']);
|
||||||
error_log($error . "\n", 3, $this->log);
|
error_log($date .' '. $error . "\n", 3, $this->log);
|
||||||
}
|
}
|
||||||
$response = false;
|
$response = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
} catch (CurlException $e) {
|
} catch (CurlException $e) {
|
||||||
error_log("[$method] " . $e->getMessage() . "\n", 3, $this->log);
|
error_log($date . " [$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||||
return false;
|
return false;
|
||||||
} catch (InvalidJsonException $e) {
|
} catch (InvalidJsonException $e) {
|
||||||
error_log("[$method] " . $e->getMessage() . "\n", 3, $this->log);
|
error_log($date . " [$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user