First of all, you can set how errors are handled by PDOs using the PDO::setAttribute method to set PDO::ATTR_ERRMODE (error report).
In particular, you can configure PDO to throw exceptions when there was an error, instead of the error message, this is what I usually do.
Then, when the method can throw an exception, the documentation should be indicated in it - in general, in the "Return Value" section.
For example, PDO::prepare may throw an exception - depending on the error message (see what I wrote earlier):
If the database server cannot successfully prepare the expression, PDO::prepare() returns FALSE or PDOException (depending on error handling).
As a side element: if you find a function / method that throws an exception, and this is not indicated in its documentation, it might be a good idea to create an error report (see http://bugs.php.net/ ), so the problem fixed; -)
(Errors / errors / missing information in the documentation are processed using the bug tracker, like any other error)
source share