From 94b20af64c9e0826b9cab3433873d689e6e3d4f7 Mon Sep 17 00:00:00 2001 From: Jinwei Zhao Date: Tue, 31 Jan 2017 19:39:47 +0800 Subject: parse message --- ingrex/intel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ingrex') diff --git a/ingrex/intel.py b/ingrex/intel.py index 506c6bc..2cc4e7f 100755 --- a/ingrex/intel.py +++ b/ingrex/intel.py @@ -43,14 +43,14 @@ class Intel(object): count = 0 while count < 3: try: - request = self.session.post(url, data=json.dumps(payload), headers=self.headers, timeout=600) + request = self.session.post(url, data=json.dumps(payload), headers=self.headers, timeout=(10, 60)) return request.json()['result'] except requests.ConnectionError: - raise IntelError + raise IntelException except Exception: count += 1 continue - raise CookieError + raise CookieException def fetch_msg(self, mints=-1, maxts=-1, reverse=False, tab='all'): "fetch message from Ingress COMM, tab can be 'all', 'faction', 'alerts'" @@ -133,12 +133,12 @@ class Intel(object): return self.fetch(url, payload) -class IntelError(BaseException): +class IntelException(BaseException): """Intel Error""" pass -class CookieError(IntelError): +class CookieException(IntelException): """Intel Error""" pass -- cgit v1.2.3