After working with Nodejs, i got used to various promise-based api's that would throw an exception/error in case of some error.
In both Codeigniter and Laravel, i see that the ALL examples of querying sort of "assume" that everything "will be ok": no try-catch or any other form of error handling.
For instance, i see that CI's "insert" method returns true on success, false on failure. Despite that, none of the examples i've seen, uses any if/else Boolean check on the operation. Same goes for Laravel, which is obviously a much more modern and professional framework.
What i did for now, is to manually check for "true" or "false", for every query that returns a boolean, but the problem is some methods return other types, like the "insert_batch" methods, whose return type is stated as "mixed".
Can someone shed a light on this issue? What approach do others take, to make sure nothing breaks, due to poor database error handling?
A link for the relevant section in CI's docs: https://www.codeigniter.com/user_guide/database/query_builder.html?highlight=query%20builder