From aff4dc40868b8e0fbfbc740bed17bc9ffd3991bb Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 30 Oct 2016 04:42:21 +0100 Subject: [PATCH] [mod] more verbose error --- locales/en.json | 2 +- src/yunohost/certificate.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/locales/en.json b/locales/en.json index 35da2eef0..c2f7b7402 100644 --- a/locales/en.json +++ b/locales/en.json @@ -249,7 +249,7 @@ "certmanager_error_parsing_dns" : "Error parsing the return value from the DNS API : {value:s}. Please verify your DNS configuration for domain {domain:s}. Use --no-checks to disable checks.", "certmanager_domain_dns_ip_differs_from_public_ip" : "The DNS 'A' record for domain {domain:s} is different from this server IP. Give some time for the DNS to refresh, or use --no-checks to disable checks.", "certmanager_no_A_dns_record" : "No DNS record of type A found for {domain:s}. You need to configure the DNS for your domain before installing a certificate !", - "certmanager_cannot_read_cert": "Something wrong happened when trying to open current certificate for domain {domain:s} (file : {file:s})", + "certmanager_cannot_read_cert": "Something wrong happened when trying to open current certificate for domain {domain:s} (file : {file:s}), reason: {reason:s}", "certmanager_cert_install_success" : "Successfully installed Let's Encrypt certificate for domain {domain:s} !", "certmanager_cert_renew_success" : "Successfully renewed Let's Encrypt certificate for domain {domain:s} !" } diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index e11ea9e3b..9d19d84cd 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -491,8 +491,10 @@ def _get_status(domain): try: cert = crypto.load_certificate(crypto.FILETYPE_PEM, open(cert_file).read()) - except: - raise MoulinetteError(errno.EINVAL, m18n.n('certmanager_cannot_read_cert', domain=domain, file=cert_file)) + except Exception as exception: + import traceback + traceback.print_exc(file=sys.stdout) + raise MoulinetteError(errno.EINVAL, m18n.n('certmanager_cannot_read_cert', domain=domain, file=cert_file, reason=exception)) certSubject = cert.get_subject().CN certIssuer = cert.get_issuer().CN