Handing errors in my code using Exceptions |
(09-22-2015, 07:59 AM)mwhitney Wrote:(09-21-2015, 04:21 PM)jLinux Wrote: If ErrorException or Exception shouldn't be used, I can create my own (http://php.net/manual/en/language.exceptions.php#91159) I think you think that I plan on using exceptions to basically generate every error message or notification (Which if thats how I came across, then I apologize). I really only plan on using it for serious issues, such as when an error in a lib/model was encountered that should terminate the execution of the model. Small example.. PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Edit: Hm, that does mean that I would have to catch the exception in the models as well, if its relying on a method that throws exceptions |
Messages In This Thread |
Handing errors in my code using Exceptions - by jLinux - 09-17-2015, 09:54 PM
RE: Handing errors in my code using Exceptions - by musheertm - 09-21-2015, 03:03 AM
RE: Handing errors in my code using Exceptions - by mwhitney - 09-21-2015, 07:30 AM
RE: Handing errors in my code using Exceptions - by includebeer - 09-21-2015, 03:55 PM
RE: Handing errors in my code using Exceptions - by jLinux - 09-21-2015, 04:21 PM
RE: Handing errors in my code using Exceptions - by mwhitney - 09-22-2015, 07:59 AM
RE: Handing errors in my code using Exceptions - by jLinux - 09-22-2015, 10:03 AM
RE: Handing errors in my code using Exceptions - by mwhitney - 09-28-2015, 09:16 AM
RE: Handing errors in my code using Exceptions - by mwhitney - 09-22-2015, 07:34 AM
RE: Handing errors in my code using Exceptions - by includebeer - 09-25-2015, 03:58 PM
RE: Handing errors in my code using Exceptions - by jLinux - 09-21-2015, 03:41 PM
|