Hello everyone,
I have created MY_Exceptions class which extends CI_Exceptions to be able to overwrite the error methods natively called by CodeIgniter. However, when manually calling these methods I want to be able to send a custom message to the error pages, for example using show_404('Custom message'). But I found that calling show_404() directly is actually calling a method from Common.php which then calls the exception class, i don't want to modify Common.php to change the parameters since that would mean changing the system folder contents.
I was wondering if someone could guide me on best practices to follow when customizing the error pages. For example, should i create an errors controller and redirect users there? Should i edit Common.php in order to fully change the show_404 function?
I hope there is an option using the native error handlers
Thanks for taking the time to read.
BTW, I started using CodeIgniter a few weeks ago and I'm loving it.