Closed dunhamjared closed 5 years ago
My bad.
I was assigning my own PDO connection via setPdo
and did not know that you have to set the PDO::ATTR_ERRMODE
to PDO::ERRMODE_EXCEPTION
for exemptions to work when doing this.
For anyone doing this, these are the options set via the SqlServerConnector
:
$options = [
PDO::ATTR_CASE => PDO::CASE_NATURAL,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
PDO::ATTR_STRINGIFY_FETCHES => false,
]
Description:
When an insert fails, an Exception is not thrown.
Steps To Reproduce:
A simple insert with an invalid column name should fail to insert. This will not throw a
QueryException
.If you enable query log and run the query manually, the database returns an error:
SQL Error (1054): Unknown column column_name
Is this by design?