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:
parent
9f7a0e6907
commit
85db4db01d
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user