better logging for exceptions around all plugins

This commit is contained in:
Hossein Shafagh 2020-10-22 15:59:38 -07:00
parent 55f219e97a
commit 03d1af16e7
1 changed files with 6 additions and 1 deletions

View File

@ -359,7 +359,12 @@ def create(**kwargs):
try:
cert_body, private_key, cert_chain, external_id, csr = mint(**kwargs)
except Exception:
current_app.logger.error("Exception minting certificate", exc_info=True)
log_data = {
"message": "Exception minting certificate",
"issuer": kwargs["authority"].name,
"cn": kwargs["common_name"],
}
current_app.logger.error(log_data, exc_info=True)
sentry.captureException()
raise
kwargs["body"] = cert_body