diff options
Diffstat (limited to 'ogcp/og_server.py')
-rw-r--r-- | ogcp/og_server.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ogcp/og_server.py b/ogcp/og_server.py index 07ee682..872798e 100644 --- a/ogcp/og_server.py +++ b/ogcp/og_server.py @@ -32,15 +32,21 @@ class OGServer: return r def post(self, path, payload): - r = requests.post(f'{self.URL}{path}', - headers=self.HEADERS, - json=payload) + try: + r = requests.post(f'{self.URL}{path}', + headers=self.HEADERS, + json=payload) + except requests.exceptions.ConnectionError: + return None return r def delete(self, path, payload): - r = requests.delete(f'{self.URL}{path}', - headers=self.HEADERS, - json=payload) + try: + r = requests.delete(f'{self.URL}{path}', + headers=self.HEADERS, + json=payload) + except requests.exceptions.ConnectionError: + return None return r @property |