mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 20:41:21 -05:00
GoogleCloud: add debugging, error handling
This commit is contained in:
parent
6528ab0892
commit
71a091e0c2
@ -68,7 +68,7 @@ class GoogleCloud(callbacks.Plugin):
|
||||
log.debug("GoogleCloud: Error accessing {0}: {1}".format(url, response.content.decode()))
|
||||
return
|
||||
result = json.loads(response.content)
|
||||
if not response:
|
||||
if not result.get('data'):
|
||||
log.debug("GoogleCloud: Error opening JSON response")
|
||||
return
|
||||
if result['data']['translations'][0].get('detectedSourceLanguage'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user