summaryrefslogtreecommitdiff
path: root/mirrors
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-08 20:36:51 -0500
committerDan McGee <dan@archlinux.org>2012-07-08 21:07:04 -0500
commita87da032cb6b5b84624e4205b5f8b7cab37249cd (patch)
treeb950418ffad07768c6c7e5fdb4581b7e41562942 /mirrors
parentb95b0cd4197d70831754a7e81b40388c37ab1a3d (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')
-rw-r--r--mirrors/management/commands/mirrorcheck.py6
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."