Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Falaleev Maxim committed Feb 26, 2015
1 parent 29674b5 commit 8541316
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Mindy/Application/BaseApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,18 +923,23 @@ public function handleError($code, $message, $file, $line)
$log = "$message ($file:$line)\nStack trace:\n";
$trace = debug_backtrace();
// skip the first 3 stacks as they do not tell the error position
if (count($trace) > 3)
if (count($trace) > 3) {
$trace = array_slice($trace, 3);
}
foreach ($trace as $i => $t) {
if (!isset($t['file']))
if (!isset($t['file'])) {
$t['file'] = 'unknown';
if (!isset($t['line']))
}
if (!isset($t['line'])) {
$t['line'] = 0;
if (!isset($t['function']))
}
if (!isset($t['function'])) {
$t['function'] = 'unknown';
}
$log .= "#$i {$t['file']}({$t['line']}): ";
if (isset($t['object']) && is_object($t['object']))
if (isset($t['object']) && is_object($t['object'])) {
$log .= get_class($t['object']) . '->';
}
$log .= "{$t['function']}()\n";
}
if (isset($_SERVER['REQUEST_URI'])) {
Expand Down

0 comments on commit 8541316

Please sign in to comment.