Production environment: error page for fatal errors |
[eluser]Unknown[/eluser]
Hi guys, Do any of you know if there is a possibility to show a nice error page when a fatal error occurs? When you set the environment variable in index.php to 'production' the page just stays white, and I think it is convenient to show a page with some description. Of course I could modify the default CodeIgniter code, but I would like to avoid that, so I am hoping one of you could help me out with some idea's.
[eluser]CroNiX[/eluser]
You'd probably have to create a MY_Exceptions to create that functionality. But, there shouldn't be any fatal errors on a production box. That would indicate a bug that needs fixing.
[eluser]Unknown[/eluser]
Of course those needs fixing, but if there may occur a fatal error, for example, when a file is missing, it would be nice if there was something more than just a blank page, in general users do not know what to do with a blank screen. So besides extending the core class there is no way this could be implemented? Well, it is way better than nothing. Thank you for your response.
[eluser]skunkbad[/eluser]
You could create a custom error handler in a hook, using set_error_handler. I use one that emails me the error info. Code: <?php You could easily customize this to display whatever you want to the site visitor. |
Welcome Guest, Not a member yet? Register Sign In |