1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-09-27 16:31:42 +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, 'txt': txt,
'src': 'its-not-a-real-python-sdk' 'src': 'its-not-a-real-python-sdk'
} }
try:
r = requests.post(api, params=parameters, timeout=3) 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) value = r.json().get('score_tag', None)
if not value: if not value:
raise Error(r.json()) raise Error(r.json())