Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Respect PDO error mode throughout codebase #204

Open
smaddock opened this issue Apr 28, 2021 · 0 comments
Open

[Feature request] Respect PDO error mode throughout codebase #204

smaddock opened this issue Apr 28, 2021 · 0 comments

Comments

@smaddock
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant