mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Check that the error file exists in Debug (from r82791)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89723 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d1af532bf4
commit
1e09bc4907
@ -383,16 +383,17 @@ class Debug {
|
||||
$reporter->writeHeader($httpRequest);
|
||||
$reporter->writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext);
|
||||
|
||||
$lines = file($errfile);
|
||||
if(file_exists($errfile)) {
|
||||
$lines = file($errfile);
|
||||
|
||||
// Make the array 1-based
|
||||
array_unshift($lines,"");
|
||||
unset($lines[0]);
|
||||
|
||||
$offset = $errline-10;
|
||||
$lines = array_slice($lines, $offset, 16, true);
|
||||
$reporter->writeSourceFragment($lines, $errline);
|
||||
// Make the array 1-based
|
||||
array_unshift($lines,"");
|
||||
unset($lines[0]);
|
||||
|
||||
$offset = $errline-10;
|
||||
$lines = array_slice($lines, $offset, 16, true);
|
||||
$reporter->writeSourceFragment($lines, $errline);
|
||||
}
|
||||
$reporter->writeTrace(($errcontext ? $errcontext : debug_backtrace()));
|
||||
$reporter->writeFooter();
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user