Skip to content

Commit

Permalink
APPSRE-10229 catch exception (#4511)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishi0x01 authored Jun 28, 2024
1 parent b0b1c10 commit 2864f14
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions reconcile/dynatrace_token_provider/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ def reconcile(self, dry_run: bool, dependencies: Dependencies) -> None:
with metrics.transactional_metrics(self.name):
unhandled_exceptions = []
for ocm_env_name, ocm_client in dependencies.ocm_client_by_env_name.items():
clusters = ocm_client.discover_clusters_by_labels(
label_filter=subscription_label_filter().like(
"key", dtp_label_key("%")
),
)
clusters: list[Cluster] = []
try:
clusters = ocm_client.discover_clusters_by_labels(
label_filter=subscription_label_filter().like(
"key", dtp_label_key("%")
),
)
except Exception as e:
unhandled_exceptions.append(f"{ocm_env_name}: {e}")
metrics.set_gauge(
DTPClustersManagedGauge(
integration=self.name,
Expand Down

0 comments on commit 2864f14

Please sign in to comment.