Making error reporting compatible with multiple errors
This commit is contained in:
parent
2ce0a48f03
commit
8839cf79b9
26
bhl.inc.php
26
bhl.inc.php
|
@ -271,20 +271,22 @@ function bhl_handle_error_result(array $ret_out, $err_file, $exit = true)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
$err = file_get_contents($err_file);
|
||||
$jerr = json_decode($err);
|
||||
if(!$jerr)
|
||||
$err_lines = file($err_file);
|
||||
foreach($err_lines as $err)
|
||||
{
|
||||
stderr("Something went wrong, bhl error is in invalid format: $err");
|
||||
if($exit)
|
||||
exit(1);
|
||||
}
|
||||
$file = $jerr->file;
|
||||
$jerr = json_decode($err);
|
||||
if(!$jerr)
|
||||
{
|
||||
stderr("Something went wrong, bhl error is in invalid format: $err");
|
||||
continue;
|
||||
}
|
||||
|
||||
stderr("BHL ERROR: \n" . $jerr->error . " \nin '$file', line {$jerr->line}\n");
|
||||
if(file_exists($file))
|
||||
stderr(bhl_show_position($jerr->line, $jerr->column, file($file)) . "\n");
|
||||
if($exit)
|
||||
$file = $jerr->file;
|
||||
stderr("BHL ERROR: \n" . $jerr->error . " \nin '$file', line {$jerr->line}\n");
|
||||
if(file_exists($file))
|
||||
stderr(bhl_show_position($jerr->line, $jerr->column, file($file)) . "\n");
|
||||
}
|
||||
if($err_lines && $exit)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue