summaryrefslogtreecommitdiffstats
path: root/ogcp/og_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/og_server.py')
-rw-r--r--ogcp/og_server.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ogcp/og_server.py b/ogcp/og_server.py
index 07dcb2b..0f542ff 100644
--- a/ogcp/og_server.py
+++ b/ogcp/og_server.py
@@ -23,9 +23,12 @@ class OGServer:
self.HEADERS = {'Authorization' : self.api_token}
def get(self, path, payload=None):
- r = requests.get(f'{self.URL}{path}',
- headers=self.HEADERS,
- json=payload)
+ try:
+ r = requests.get(f'{self.URL}{path}',
+ headers=self.HEADERS,
+ json=payload)
+ except requests.exceptions.ConnectionError:
+ return None
return r
def post(self, path, payload):