[IMP] attachment_azure: add stack_info on ResourceExistsError

The blob already exists, so the exception traceback (inside upload_blob)
is not useful on its own. Adding stack_info=True to _logger.exception()
also logs the call stack, revealing who triggered the duplicate write.
This commit is contained in:
Vincent Van Rossem
2026-04-14 15:22:34 +02:00
parent a10411107c
commit d0fcf012c1
+6 -2
View File
@@ -177,8 +177,12 @@ class IrAttachment(models.Model):
try:
blob_client.upload_blob(file, blob_type="BlockBlob")
except ResourceExistsError:
_logger.exception(
"Trying to re create an existing resource %s" % filename
(
_logger.exception(
"Trying to re create an existing resource %s",
filename,
stack_info=True,
),
)
except HttpResponseError as error:
# log verbose error from azure, return short message for user