Google News
logo
CodeIgniter - Interview Questions
How to deal with Error handling in CodeIgniter?
CodeIgniter enables you to develop error reporting into your applications by using the below-given functions. Also, it has a class dedicated to error logging that permits messages related to error and debugging to be saved as text files.
 
Functions related to error handling are :
 
This function will display the error message provided by the application/errors/errorgeneral.php template.
show_error(‘message’ [, int $statuscode= 500 ] )​
This function shows the 404 error message supplied to it by using the application/errors/error404.php template.
show_404(‘page’ [, ‘logerror’])​

 

This function permits you to write messages onto your log files. You must provide anyone among three “levels” in the first parameter that indicates the message type (debug, error, info), with the message itself in the second parameter.
log_message(‘level’, ‘message’)​
Advertisement