From cabfa05f1c290bfb29c57ab4b37cffafb4b9b70b Mon Sep 17 00:00:00 2001 From: Nicholas Rejack Date: Fri, 19 Feb 2016 17:45:52 -0500 Subject: [PATCH 1/3] Adding a new exception to watch for in redcapClient.py: ConnectionError --- redi/utils/redcapClient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redi/utils/redcapClient.py b/redi/utils/redcapClient.py index 18851de..4c9aac7 100644 --- a/redi/utils/redcapClient.py +++ b/redi/utils/redcapClient.py @@ -21,6 +21,7 @@ from requests import RequestException from requests.packages.urllib3.exceptions import MaxRetryError from requests.packages.urllib3.exceptions import NewConnectionError +from requests.exceptions import ConnectionError # Configure module's logger logger = logging.getLogger(__name__) @@ -116,9 +117,9 @@ def send_data_to_redcap(self, data, max_retry_count, overwrite=False, response = self.project.import_records(data, overwrite=overwrite_value) return response - except (MaxRetryError, NewConnectionError) as e: + except (MaxRetryError, NewConnectionError, ConnectionError) as e: logger.error("Exception encountered: ", exc_info = True) - logger.debug(e.message + ", Attempt no.: " + str(retry_count)) + logger.debug(str(e.message) + ", Attempt no.: " + str(retry_count)) if (retry_count == max_retry_count): message = "Exiting since network connection timed out after"\ " reaching the maximum retry limit for resending data." From 0dcf6f828cadf8526a51139b475ddbc2c5a3bdd5 Mon Sep 17 00:00:00 2001 From: Christopher Barnes Date: Fri, 11 Mar 2016 13:43:14 -0500 Subject: [PATCH 2/3] add .egg and virtualenvironment folder venv from instructions to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e688c88..e6fea58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.egg +venv/ *.pyc *.pyo *.egg-info/ From 94d665589af2f954025a38974c6345894f3cf2a9 Mon Sep 17 00:00:00 2001 From: Christopher Barnes Date: Fri, 11 Mar 2016 13:46:05 -0500 Subject: [PATCH 3/3] add .eggs as correction for directory name to .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e6fea58..2f22350 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -*.egg +*.eggs venv/ *.pyc *.pyo