Skip to content

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

Open
@smaddock

Description

@smaddock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions