Open rgasper opened 1 year ago
The specific error I was experiencing that wasn't getting handled was
IMC06 | The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.
Which was raised as a Database.Error
with that detail message
Thanks for bringing this up. This is definitely something we'll look into doing.
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it With the exception of back-off errors that are handled, database errors get raised as "raw"
Error
objects, making catching them properly more challenging.Describe the preferred solution Database errors should be caught, their codes parsed, and re-raised as one of the PEP-249 error types.
Reference Documentations/Specifications https://docs.djangoproject.com/en/4.2/ref/exceptions/#database-exceptions https://peps.python.org/pep-0249/
Looks like the correct spot to fix this would go quite naturally in this function: https://github.com/microsoft/mssql-django/blob/a429dd17f2412d67c9442ecfe3abe21836cffdf0/mssql/base.py#L504