CodeIgniter Forums
Error/Exception handling - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Error/Exception handling (/showthread.php?tid=37038)



Error/Exception handling - El Forum - 12-24-2010

[eluser]sqwk[/eluser]
How would I best use exceptions in Codeigniter? Do I just throw a new Exception and then catch it somewhere? Does that stop the execution of the code in the current file only or do exceptions bubble up and stop everything? Do they get logged by CI? When they are thrown or when they are caught? Does CI show an error message automatically or do I need to use show_error()?

I have a series of nested models with methods wrapped in transactions. If a transaction in a submodel fails I would assume that the parent transaction also fails? So really I don't need exceptions?

How would I best communicate something like 'No rows returned' to a parent model' as I would still like to return $this to preserve the already set attributes?

Can someone clarify some of these concepts?


Error/Exception handling - El Forum - 12-25-2010

[eluser]InsiteFX[/eluser]
CodeIgniter uses its own Exception handling Class,
You would need to Extend it.

InsiteFX