mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-22 05:06:07 +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 {
|
||||
$response = call_user_func_array(array($this->api, $method), $arguments);
|
||||
$date = date('[Y-m-d H:i:s]');
|
||||
|
||||
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'])) {
|
||||
$error = implode("\n", $response['errors']);
|
||||
error_log($error . "\n", 3, $this->log);
|
||||
error_log($date .' '. $error . "\n", 3, $this->log);
|
||||
}
|
||||
$response = false;
|
||||
}
|
||||
|
||||
return $response;
|
||||
} catch (CurlException $e) {
|
||||
error_log("[$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||
error_log($date . " [$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||
return false;
|
||||
} catch (InvalidJsonException $e) {
|
||||
error_log("[$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||
error_log($date . " [$method] " . $e->getMessage() . "\n", 3, $this->log);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user