Skip to content

Commit

Permalink
Stick everything in a big except to improve logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Mar 5, 2019
1 parent c42d6d0 commit b408e80
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions check_https.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,21 @@ def check_site(site):
info.domain = site["domain"]
info.ssllabs_grade = site.get("ssllabs_grade")

check_secure_connection(info)
if not info.secure_connection_works:
log.info("Couldn't connect securely to {}, so aborting further checks.".format(info.domain))
return info

check_https_page(info)
if not info.can_load_https_page:
log.info("Couldn't load HTTPS page for {}, so aborting further checks.".format(info.domain))
return info

check_http_page(info)
try:
check_secure_connection(info)
if not info.secure_connection_works:
log.info("Couldn't connect securely to %s, so aborting further checks.", info.domain)
return info

check_https_page(info)
if not info.can_load_https_page:
log.info("Couldn't load HTTPS page for %s, so aborting further checks.", info.domain)
return info

check_http_page(info)
except Exception:
log.exception("unexpected failure evaluating %s", info.domain)
raise

return info

Expand Down

0 comments on commit b408e80

Please sign in to comment.