From d0fcf012c1c6a77785c26a0f3241f32d08bfc7d9 Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Wed, 1 Apr 2026 16:32:32 +0200 Subject: [PATCH] [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. --- attachment_azure/models/ir_attachment.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/attachment_azure/models/ir_attachment.py b/attachment_azure/models/ir_attachment.py index ee0741fc..2d3ad9c5 100644 --- a/attachment_azure/models/ir_attachment.py +++ b/attachment_azure/models/ir_attachment.py @@ -177,8 +177,12 @@ def _store_file_write(self, key, bin_data): 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