set_error_handler in Codeigniter? set_error_handler in Codeigniter? codeigniter codeigniter

set_error_handler in Codeigniter?


You can do a few things quickly to figure out the problem.

  1. Use the above code in a standalone php script and create an intentional error. If the code works, then try to find codeigniter specific error handling mechanism.

  2. Replace the contents of the phpErrorHandler function with something simple, like printing something in the log and see if the function itself is being executed on error. If yes, then you only need to fix the code for the error handler.

  3. For codeigniter specific error handling, you can override its 'Exception' library class by creating My_Exception class in your application/libraries folder. Copy original library function signatures into it and put in your code. It will surely work.