mindplay-dk / sql

Database framework and query builder
Other
18 stars 6 forks source link

Maybe wrong error code in SQLException #38

Closed boan-jfm closed 6 years ago

boan-jfm commented 7 years ago

When I ask for the getCode() in a SQLException instance, I would expect the database error code (https://www.postgresql.org/docs/9.4/static/errcodes-appendix.html), and not the driver error code.

I think it falls back to this mapping: https://github.com/mindplay-dk/sql/blob/master/src/framework/pdo/PreparedPDOStatement.php#L113 where the PDO object returns two types of error code (SQLSTATE error code & Driver-specific error code).