diff options
| author | 2016-06-24 09:17:54 +0100 | |
|---|---|---|
| committer | 2016-06-24 09:17:54 +0100 | |
| commit | 64474b261aa884fcc8337a484c99a8c4c6f0a37b (patch) | |
| tree | 1391cd2323c75872a6dfd90c2d7b457a7b249f69 /Utils.py | |
| parent | added a part command to admin.py. (diff) | |
added handling URLError to Utils.get_url.
Diffstat (limited to 'Utils.py')
| -rw-r--r-- | Utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -59,6 +59,12 @@ def get_url(url, **kwargs): return e.code, False else: return False + except urllib.error.URLError as e: + traceback.print_exc() + if kwargs.get("code"): + return -1, False + else: + return False response_content = response.read() encoding = response.info().get_content_charset() |
