From f98ce7c95832b6f810d6c7213ed691a95e9254fc Mon Sep 17 00:00:00 2001 From: Simon Kelly Date: Fri, 5 Mar 2021 10:26:03 +0200 Subject: [PATCH] handle None response This happens if the connection times out --- commcare_export/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commcare_export/cli.py b/commcare_export/cli.py index c65c8cf0..b6637f64 100644 --- a/commcare_export/cli.py +++ b/commcare_export/cli.py @@ -259,7 +259,7 @@ def evaluate_query(env, query): force_lazy_result(lazy_result) return 0 except requests.exceptions.RequestException as e: - if e.response.status_code == 401: + if e.response and e.response.status_code == 401: print("\nAuthentication failed. Please check your credentials.", file=sys.stderr) return EXIT_STATUS_ERROR else: