Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Set error screen

posted by jmtucu 7 years ago

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?

There's nothing particularly wrong with that code unless the exception is occurring also on the /home/error page. This seems like a pretty narrow range, but my suggestion would be to put your exception handling out to HTML for development so you can see where the exception is occurring and actually pinpoint what is causing it.

posted by mattsah 7 years ago

The error screen it's only a fashion html message, so it's imposible that fail in that file. Now I've to disable this until has a solution because Chrome still show me the redirection loop. Thanks for the reply!

posted by jmtucu 7 years ago