X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=php%2Fplc_api.php;fp=php%2Fplc_api.php;h=4850bfa2ae4d35ed7b08bbad78c1bd2c8f4139fe;hb=f2aa922463ac2d2d7b1de4de4c63116232070f4d;hp=cb7257ad9c67826164d1c3ec26cc9b5e61ebdacf;hpb=3cdf2e7bfccc337c7d5cdf13c43224973ddbc795;p=plcapi.git diff --git a/php/plc_api.php b/php/plc_api.php index cb7257a..4850bfa 100644 --- a/php/plc_api.php +++ b/php/plc_api.php @@ -49,8 +49,11 @@ class PLCAPI $file = $backtrace[$backtrace_level]['file']; $line = $backtrace[$backtrace_level]['line']; - $this->errors[] = 'PLCAPI error: ' . $error_msg . ' in ' . $file . ' on line ' . $line; - error_log(end($this->errors)); + $error_line='PLCAPI error: ' . $error_msg ; + if ($file) $error_line .= ' in file ' . $file; + if ($line) $error_line .= ' on line ' . $line; + $this->errors[] = $error_line; + error_log($error_line); } function error()