Description
Currently, PDO::ATTR_ERRMODE
attribute can be set as a driver option for new xPDO\xPDOConnection
instances. Setting it to PDO::ERRMODE_EXCEPTION
changes the error reporting behavior of PDO to throw Exceptions instead of emitting errors, which are cleaner to handle in late versions of PHP.
There is no similar option for xPDO-specific error reporting, such as on newObject
, getObject
, getCollectionGraph
, etc. These functions will return null
or false
in case of an error, which requires some (admittedly simple but) custom error handling to account for those values, instead of being able to use the more standard try
/catch
blocks, potentially higher up in a project.
This request is to mirror the PDO::ATTR_ERRMODE
attribute behavior in the xPDO codebase.