diff options
author | Rob Austein <sra@hactrn.net> | 2016-01-16 17:01:55 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-01-16 17:01:55 +0000 |
commit | 565f27716014aed53a98f550e6a28bc7f4da9dfd (patch) | |
tree | b18a6f3416171956c8b2678e4b4ccdee91c72db8 /rp | |
parent | aadeb61a75db8d00c48bfc9a9d57dd10ee0d9e99 (diff) |
More exception handling (socket.error, IOError, ...).
svn path=/branches/tk705/; revision=6226
Diffstat (limited to 'rp')
-rwxr-xr-x | rp/rcynic/rcynicng | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/rp/rcynic/rcynicng b/rp/rcynic/rcynicng index 9ae395b6..9fa174eb 100755 --- a/rp/rcynic/rcynicng +++ b/rp/rcynic/rcynicng @@ -11,6 +11,7 @@ import sys import time import errno import shutil +import socket import logging import argparse import urlparse @@ -928,13 +929,17 @@ class Fetcher(object): ok = True except tornado.httpclient.HTTPError as e: + # Might want to check e.response here to figure out whether to add to _https_deadhosts. logger.info("HTTP error for %s: %s", url, e) - # Might want to check response code here to figure out - # whether to list this host in _https_deadhosts. raise - except: - logger.exception("Error for %s", url) + except (socket.error, IOError) as e: + # Might want to check e.errno here to figure out whether to add to _https_deadhosts. + logger.info("Network I/O error for %s: %s", url, e) + raise + + except Exception as e: + logger.exception("Error (%r) for %s", type(e), url) raise finally: @@ -1104,8 +1109,8 @@ class Fetcher(object): obj.snapshot.add(new_snapshot) obj.save() - except tornado.httpclient.HTTPError as e: - pass + except (tornado.httpclient.HTTPError, socket.error, IOError): + pass # Already logged except RRDP_ParseFailure as e: logger.info("RRDP parse failure: %s", e) |