Is there a common standard for reporting errors in your class functions?
I've seen some c functions that you pass the error string to, so that if there is an error you can see what it is in that string, You need pointers for that though.
I'm reluctant to use the return, because sometimes you do need the return for other variables.
One thing I was trying is using a standardized return object that has an error key inside, as well as the data. This seems to work ok, but when using it with other classes, seems a bit clumsy.
so here's my latest idea, the class has an internal variable $error and every time a function is called, $error gets cleared, and updated with the error string or array (could even hold more than one error) and when the function completes we can check if the error is empty.
here's the problem with that, if I'm using functions within functions, I end up clearing the error. I could hold the string inside a different var, and only push it to error once the before return.
any other ideas to do this gracefully and reliably?