better exception handling

This commit is contained in:
Hossein Shafagh 2021-01-28 15:38:59 -08:00
parent 6eeafcf56b
commit b9b3ae2286
1 changed files with 5 additions and 0 deletions

View File

@ -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