Skip to content

Commit e516b70

Browse files
Copilotswathipil
andcommitted
Add debug logging for exceptions in list_ownership method
Co-authored-by: swathipil <[email protected]>
1 parent f831d8f commit e516b70

File tree

1 file changed

+11
-2
lines changed
  • sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob

1 file changed

+11
-2
lines changed

sdk/eventhub/azure-eventhub-checkpointstoreblob/azure/eventhub/extensions/checkpointstoreblob/_blobstoragecs.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,17 @@ def list_ownership(
252252
}
253253
result.append(ownership)
254254
return result
255-
except Exception:
256-
# Re-raising the exception without logging it to comply with rule C4762 (do-not-log-raised-errors)
255+
except Exception as error:
256+
# Using debug level to comply with rule C4762 (do-not-log-raised-errors)
257+
logger.debug(
258+
"An exception occurred during list_ownership for "
259+
"namespace %r eventhub %r consumer group %r. "
260+
"Exception is %r",
261+
fully_qualified_namespace,
262+
eventhub_name,
263+
consumer_group,
264+
error,
265+
)
257266
raise
258267

259268
def claim_ownership(self, ownership_list: Iterable[Dict[str, Any]], **kwargs: Any) -> Iterable[Dict[str, Any]]:

0 commit comments

Comments
 (0)