Skip to content

Commit f831d8f

Browse files
Copilotl0lawrence
andcommitted
Fix do-not-log-raised-errors (C4762) issue in list_ownership method
Co-authored-by: l0lawrence <[email protected]>
1 parent 6a5929a commit f831d8f

File tree

1 file changed

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

1 file changed

+2
-10
lines changed

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

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

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

0 commit comments

Comments
 (0)