Nefunkční set_error_handler při použití Tracy

- vit.peprnicek
 - Člen | 20
 
Ahoj,
v aplikaci generuju PHP kód (anonymní třídu) a chci odchytit chybu pokud je
v kódu chyba. Problém je v tom že pokud je v souboru syntaktická chyba,
odchytne ji až Tracy. Co by mohlo být špatně? Je jiná možnost jak toto
udělat jinak?
<?php
try
{
	$oeh = set_error_handler(function($errno, $errstr, $errfile, $errline) {
		throw new ExceptionSyntaxError("Chyba v přeložené skriptu: ".$errno.": ".$errstr);
	}, E_ALL);
	// include generovaného souboru s chybou
	// Obsah souboru je
	// <?php return new class { ....
	$ints = include("../temp/cache/Scripting/0.php");
	restore_error_handler();
}
catch(ExceptionSyntaxError $exc)
{
	echo "Chyba ve vygenerovaném scriptu: ".$exc->getMessage();
}
?>
				
- David Matějka
 - Moderator | 6445
 
viz dokumentace set_error_handler
The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.
tracy to chyta az v shutdown handleru