unless i'm mistaken there might be something like that with the try catch system. I've seen a little bit of this, like i'm pretty sure that there is a way to get the specific mysql error code and info from that, but as for errors in a function, i think try catch might be your best solution, and maybe toss an error message into a database table or log file.