mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 06:04:21 +01:00
Refactors cli to avoid multi-type returns (normal return + None). Adds exceptions for errors.
This commit is contained in:
@@ -263,7 +263,7 @@ def post_request(data, endpoint):
|
|||||||
return requests.post(url=endpoint, json=data, timeout=5)
|
return requests.post(url=endpoint, json=data, timeout=5)
|
||||||
|
|
||||||
except Timeout:
|
except Timeout:
|
||||||
message = "Can't connect to the Eye of Satoshi's API. Connection timeout"
|
message = "Cannot connect to the Eye of Satoshi's API. Connection timeout"
|
||||||
|
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
message = "Cannot connect to the Eye of Satoshi's API. Server cannot be reached"
|
message = "Cannot connect to the Eye of Satoshi's API. Server cannot be reached"
|
||||||
|
|||||||
Reference in New Issue
Block a user