MJ Error: ";
$return .= str_replace("\n", "
\n", $this->getMessage())."
\n";
$trace = $this->getTrace();
$file = reset($trace);
//смещение в трейсе, указаное при вызове эксепшена (2й параметр). Нужно для более инофрмативного вывода
if ($shift = abs($this->getCode())) {
while($shift--) {
$file = next($trace);
}
}
if ($fp = fopen($file['file'], 'r')) {
$error_line = $file['line'];
$start = $error_line - $this->line_range;
$end = $error_line + $this->line_range;
$i = 1;
$return .= "
";
while ($line = fgets($fp, 4096) and $i<=$end) {
$line = htmlspecialchars($line);
if ($i >= $start && $i <= $end) {
if ($i == $error_line) $return .= ''.$i.' '.$line.'';
else $return .= $i.' '.$line;
}
$i++;
}
$return .= "";
fclose($fp);
}
$return .= '| ".$this->getFile().' | '.$this->getLine().' |
| ".$row['file'].' | '.$row['line'].' |