On my latest site I have made use of exceptions in an ODBC wrapper class which I have written. My class will throw and exception if a query fails. I have also set a custom error handler function which catches all warnings and notices and logs them in a file.
The problem is when a query fails, the ODBC function which executes it also generates a warning, which is then logged. As I have already thrown an exception, I would like to disable this.
At present, my error handling class is testing the error_reporting PHP setting to determine whether an error should be logged. So plan to disable the warning by lowering the error level before executing each query and returning it back to what it was after. I would however like to know if there is a more elegant way of doing this.
Thanks
Ps: I've included the code for both the error handling class and the odbc wrapper class for reference.