Skip to content

Commit

Permalink
Wrap exception for CertificateNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
jtschladen committed Feb 12, 2025
1 parent 3f55e6d commit 78b1bb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lemur/plugins/lemur_aws/elb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
"""
import botocore
from flask import current_app

from retrying import retry
from sentry_sdk import capture_exception

from lemur.extensions import metrics
from lemur.exceptions import InvalidListener
from lemur.extensions import metrics
from lemur.plugins.lemur_aws.sts import sts_client


Expand Down Expand Up @@ -437,6 +436,8 @@ def attach_certificate_v2(listener_arn, port, certificates, **kwargs):
except botocore.exceptions.ClientError as e:
if e.response["Error"]["Code"] == "LoadBalancerNotFound":
current_app.logger.warning("Loadbalancer does not exist.")
elif e.response["Error"]["Code"] == "CertificateNotFound":
raise Exception(f"Certificate not found for listener arn {listener_arn}: {e}")
else:
raise e

Expand Down

0 comments on commit 78b1bb8

Please sign in to comment.