summaryrefslogtreecommitdiffstats
path: root/mirrors/management
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-09 03:36:51 +0200
committerDan McGee <dan@archlinux.org>2012-07-09 04:07:04 +0200
commita87da032cb6b5b84624e4205b5f8b7cab37249cd (patch)
treeb950418ffad07768c6c7e5fdb4581b7e41562942 /mirrors/management
parentb95b0cd4197d70831754a7e81b40388c37ab1a3d (diff)
downloadarchweb-a87da032cb6b5b84624e4205b5f8b7cab37249cd.tar.gz
archweb-a87da032cb6b5b84624e4205b5f8b7cab37249cd.tar.xz
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')
-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 ae89d5e..3d43179 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."