CodeIgniter Error Handling
CodeIgniter Error Handling
CodeIgniter has a provision to handle the errors in your application. We can also log the errors to the file.
By default CodeIgniter shows the all errors in the browser. While you are developing the application this must be to true otherwise errors will be not shown to the developers. When you are moving the application to Production this must be set to false.
To set this flag to true or false go to main 'index.php' which will be reside at top level.
[php]
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
[/php]