![]() |
Production environment: error page for fatal errors - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Production environment: error page for fatal errors (/showthread.php?tid=50321) |
Production environment: error page for fatal errors - El Forum - 03-22-2012 [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. Production environment: error page for fatal errors - El Forum - 03-22-2012 [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. Production environment: error page for fatal errors - El Forum - 03-22-2012 [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. Production environment: error page for fatal errors - El Forum - 03-22-2012 [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. |