[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 committed 2026-04-14 15:22:34 +02:00
1 parent a10411107c
commit d0fcf012c1
1 file changed
+6 -2
+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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.