CodeIgniter PHP Exceptions

I was wondering what is the best way to handle exceptions on CodeIgniter. The usual way is to use trigger_error()or log_message(), however, I was wondering if there is a better way to use try / catch.

Any tips or tricks for implementing them in CodeIgniter?

I am currently expanding Exceptions Class, but I would like to know if anyone has dealt with this issue before.

+3
source share
1 answer

I would do something simple:

try { $this->load->model('modelname'); }

catch ( Exception $e )
{
    show_error($e);
}

, , show_error() live. ​​ MY_Model .

+4

Source: https://habr.com/ru/post/1722192/


All Articles