
Hello! How can I redirect when the error message
It appears an error has occurred - we apologize for the inconvenience. The problem may be resolved if you try again.
appears to a custom view? I want to create something more user friendy if an error occurred and keep the error in the files error.log
and exceptions.log
The files are created using
fCore::enableErrorHandling(STORAGE_PATH.'logs'.DS.'errors.log');
fCore::enableExceptionHandling(STORAGE_PATH.'logs'.DS.'exceptions.log');
But can't show another view if an error occurred.
Thanks in advanced!
EDIT:
fCore::enableErrorHandling(STORAGE_PATH.'logs'.DS.'errors.log');
fCore::enableExceptionHandling(STORAGE_PATH.'logs'.DS.'exceptions.log', 'pantallaError');
fCore::disableContext();
function pantallaError() {
fURL::redirect(URL_ROOT.'home/error'); # view with some nice html
die(); # just in case
}
With that works fine, but somethings I get errors into a redirection loop and the browser show me an alert. What's wrong with that code?