1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 13:08:13 +00:00

added timeout message to finally fix #5

This commit is contained in:
militarpancho 2017-03-09 16:20:16 +01:00
parent 9f7a0e6907
commit 85db4db01d

View File

@ -24,8 +24,10 @@ class DaedalusPlugin(SentimentPlugin):
'txt': txt,
'src': 'its-not-a-real-python-sdk'
}
r = requests.post(api, params=parameters, timeout=3)
try:
r = requests.post(api, params=parameters, timeout=3)
except requests.exceptions.Timeout:
raise Error("Meaning Cloud API does not response")
value = r.json().get('score_tag', None)
if not value:
raise Error(r.json())