michiya / django-pyodbc-azure

Django backend for Microsoft SQL Server and Azure SQL Database using pyodbc
https://pypi.python.org/pypi/django-pyodbc-azure
BSD 3-Clause "New" or "Revised" License
321 stars 140 forks source link

Raise OperationalError on deadlocks #186

Open MarkBird opened 6 years ago

MarkBird commented 6 years ago

Using MySQL or Postgres for DB backend, if a deadlock occurs, the exception raised is django.db.utils.OperationalError. However, using django-pyodbc-azure and SQL Server, the error is the base django.db.utils.Error.

For consistency can we raise OperationalError if a deadlock occurs (error code = '40001')?