CodeIgniter Forums
Error/Exception handling - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: Error/Exception handling (/thread-37038.html)

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

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

CodeIgniter uses its own Exception handling Class,
You would need to Extend it.