mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Append additional (error) message only if error_get_last() returns non-null value #20294
This commit is contained in:
@ -131,8 +131,9 @@ class FileTarget extends Target
|
||||
}
|
||||
$writeResult = @fwrite($fp, $text);
|
||||
if ($writeResult === false) {
|
||||
$error = error_get_last();
|
||||
throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");
|
||||
$message = "Unable to export log through file ($this->logFile)!";
|
||||
($error = error_get_last()) and $message .= ": {$error['message']}";
|
||||
throw new LogRuntimeException($message);
|
||||
}
|
||||
$textSize = strlen($text);
|
||||
if ($writeResult < $textSize) {
|
||||
|
||||
Reference in New Issue
Block a user