From b9b3ae2286d9486c2657e8f6e69cc7fb4395996d Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Thu, 28 Jan 2021 15:38:59 -0800 Subject: [PATCH] better exception handling --- lemur/certificates/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemur/certificates/cli.py b/lemur/certificates/cli.py index 4b4b22e9..8f4d9ca7 100644 --- a/lemur/certificates/cli.py +++ b/lemur/certificates/cli.py @@ -119,6 +119,11 @@ def request_rotation(endpoint, certificate, message, commit): status = SUCCESS_METRIC_STATUS except Exception as e: + sentry.captureException(extra={"certificate_name": str(certificate.name), + "endpoint": str(endpoint.dnsname)}) + current_app.logger.exception( + f"Error rotating certificate: {certificate.name}", exc_info=True + ) print( "[!] Failed to rotate endpoint {0} to certificate {1} reason: {2}".format( endpoint.name, certificate.name, e