Skip to content

Commit

Permalink
Report File Name and Line Number for Exceptions
Browse files Browse the repository at this point in the history
### Native PHP Error Handler Example (Browser's Output Buffer)
```
Parse error: syntax error, unexpected ';', expecting ',' or ')' in /var/www/cakephp/app/plugins/TableTranslate/src/Model/Behavior/TranslationsBehavior.php on line 56
```

### Patched BaseErrorHandler Parse Error Exception (PHP 7.1.2)

2017-03-06 15:28:47 Error: [ParseError] syntax error, unexpected ';', expecting ',' or ')' in /var/www/cakephp/app/plugins/TableTranslate/src/Model/Behavior/TranslationsBehavior.php on line 56
  • Loading branch information
inoas committed Mar 6, 2017
1 parent a0eca4d commit c69447c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Error/BaseErrorHandler.php
Expand Up @@ -354,9 +354,11 @@ protected function _getMessage(Exception $exception)
$exception;
$config = $this->_options;
$message = sprintf(
"[%s] %s",
"[%s] %s in %s on line %s",
get_class($exception),
$exception->getMessage()
$exception->getMessage(),
$exception->getFile(),
$exception->getLine()
);
$debug = Configure::read('debug');

Expand Down

0 comments on commit c69447c

Please sign in to comment.