You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Currently,
PDO::ATTR_ERRMODE
attribute can be set as a driver option for newxPDO\xPDOConnection
instances. Setting it toPDO::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 returnnull
orfalse
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 standardtry
/catch
blocks, potentially higher up in a project.This request is to mirror the
PDO::ATTR_ERRMODE
attribute behavior in the xPDO codebase.The text was updated successfully, but these errors were encountered: