Mods: Catchable CodeIgniter Errors

Aus CodeCoupler Wiki
Version vom 5. November 2017, 00:01 Uhr von Tm (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „Most of the functions in CodeIgniter stop the execution in case of an error by calling the method '''show_error'''. In some cases it is useful to catch such an…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Most of the functions in CodeIgniter stop the execution in case of an error by calling the method show_error. In some cases it is useful to catch such an error and handle it different. With CodeCoupler you can catch this errors:

try
{
    show_error("This is a Standard CodeIgniter Error");
    //Or call any other function of the CodeIgniter Framework that could end with an error
}
catch(Exception $exception)
{
    die("The Standard CodeIgniter Error can now be catched");
}