CodeIgniter Forums
How do I customize database error handling in model classes? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: How do I customize database error handling in model classes? (/thread-25947.html)



How do I customize database error handling in model classes? - El Forum - 01-01-2010

[eluser]Daniel Peraza[/eluser]
Hello igniters!.

Since my very first beginning with CI I have not been very pleased with CI's handling of database errors. If I execute a mis-typed query, CI goes directly to an error page instead of providing me mechanisms to take the proper actions. Although this is configurable, I still don't have methods to know whether the Database Class methods succeeds. Think of insert(), update() or delete() methods, I think they should return TRUE or FALSE whenever they succeed or fail to do their jobs. Instead I must invoke database-specific functions to guess it.

I wonder if there is any other way to achieve this effect without having to overload all this methods at all.