CodeIgniter Forums
Error Handling - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Error Handling (/showthread.php?tid=66026)



Error Handling - pb.sajjad - 08-25-2016

Hi to all developers...
In CI documentation, I've read what I must do for error handling when finishing app development. And also I've design a custom 404 error page for a better and user friendly view.

My question is: In final product, the users should not see PHP or Databases errors... but what about general errors? How could I handle those and create a better custom page for them?

suppose some users enter some disallowed characters in address bar, or a form CSRF time finished or something like these, then the users a bad error page with some messages like these:

An Error Was Encountered
The URI you submitted has disallowed characters.

thanks a lot.


RE: Error Handling - mubbi.qureshi - 08-25-2016

In Codeigniter 3.X you have extra folder in views called "errors", you can all type of errors view from there to make it user friendly


RE: Error Handling - pb.sajjad - 08-26-2016

(08-25-2016, 10:14 AM)mubbi.qureshi Wrote: In Codeigniter 3.X you have extra folder in views called "errors", you can all type of errors view from there to make it user friendly

Thanks. But I know about these folders too!

I mean, for 404 error page, I could create a controller and a method, and route to this method via $route['404_override']. In this way, I could have a page like other pages, with their theme, but for errors. How could these about general errors?