diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-08 20:36:51 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-08 21:07:04 -0500 |
commit | a87da032cb6b5b84624e4205b5f8b7cab37249cd (patch) | |
tree | b950418ffad07768c6c7e5fdb4581b7e41562942 /mirrors/management/commands | |
parent | b95b0cd4197d70831754a7e81b40388c37ab1a3d (diff) |
Handle HTTPException being thrown in mirrorcheck
Managed to see this bubble up today when running the mirrorcheck command
on a less than ideal connection that was experiencing timeouts at the
wrong time.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/management/commands')
-rw-r--r-- | mirrors/management/commands/mirrorcheck.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index ae89d5e0..3d431796 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -11,6 +11,7 @@ Usage: ./manage.py mirrorcheck from collections import deque from datetime import datetime +from httplib import HTTPException import logging import os from optparse import make_option @@ -115,6 +116,11 @@ def check_mirror_url(mirror_url, timeout): elif isinstance(e.reason, socket.error): log.error = e.reason.args[1] logger.debug("failed: %s, %s", url, log.error) + except HTTPException as e: + # e.g., BadStatusLine + log.is_success = False + log.error = "Exception in processing HTTP request." + logger.debug("failed: %s, %s", url, log.error) except socket.timeout as e: log.is_success = False log.error = "Connection timed out." |