zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
83 stars 12 forks source link

IntegrityError is not raised when expected #12

Closed joshuahlang closed 6 years ago

joshuahlang commented 6 years ago

Per https://www.python.org/dev/peps/pep-0249/#integrityerror, ctds.IntegrityError should be raised when "when the relational integrity of the database is affected". This is somewhat open-ended, but at the very least could follow pymssql's lead and handle specific error numbers. It seems as though the severity level can't be used for differentiating errors for this purpose.

The list of SQL Server 2008 error messages can be found here.

joshuahlang commented 6 years ago

Fixed in v1.8.0.