-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using custom error handler #999
Comments
Fat-Free Framework doesn't forbid to use a third party debugger or error handler. I did a few successful tests with a custom Two notes:
$f3->set('ONERROR', function () use ($f3) {
Debugger::barDump($f3->get('ERROR'), 'ERROR');
$e = $f3->get('EXCEPTION');
// There isn't an exception when calling `Base->error()`.
if (!$e instanceof Throwable) {
$e = new Exception('HTTP ' . $f3->get('ERROR.code'));
}
Debugger::exceptionHandler($e);
}); Full example: Fat-Free Framework with PHP Debugger Tracy |
The issue with using Additionally, even if we set |
Trying to access non-existent array fields is a warning in PHP 8. Also, Dice uses `ReflectionParameter::getClass()`, which is deprecated in PHP 8. Since we have not yet set an error handler at that point because it needs a `Logger` class instantiated by Dice, let’s disable deprecation warnings temporarily. Unfortunately, we cannot just re-enable them and log them in the error handler since fatfree’s error handler is extremely inflexible bcosca/fatfree#999.
Trying to access non-existent array fields is a warning in PHP 8. Though this error is masked by ddeboer/transcoder#5 in the integration tests when mbstring extension is available. Also, Dice uses `ReflectionParameter::getClass()`, which is deprecated in PHP 8. Since we have not yet set an error handler at that point because it needs a `Logger` class instantiated by Dice, let’s disable deprecation warnings temporarily. Unfortunately, we cannot just re-enable them and log them in the error handler since fatfree’s error handler is extremely inflexible bcosca/fatfree#999.
I would like to use Tracy for handling errors and exceptions since it has interesting features like AJAX error handling.
The text was updated successfully, but these errors were encountered: