Refactors cli to avoid multi-type returns (normal return + None). Adds exceptions for errors.

This commit is contained in:
Sergi Delgado Segura
2020-04-03 21:57:38 +02:00
parent 1ec69e8703
commit 32dd5cfc3f

View File

@@ -263,7 +263,7 @@ def post_request(data, endpoint):
return requests.post(url=endpoint, json=data, timeout=5)
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:
message = "Cannot connect to the Eye of Satoshi's API. Server cannot be reached"