mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
make google translate return detailed google error, instead of the unhelpful "we broke google".
This commit is contained in:
parent
127b3cfabd
commit
5e162a28f7
@ -278,7 +278,8 @@ class Google(callbacks.PluginRegexp):
|
|||||||
json = simplejson.load(fd)
|
json = simplejson.load(fd)
|
||||||
fd.close()
|
fd.close()
|
||||||
if json['responseStatus'] != 200:
|
if json['responseStatus'] != 200:
|
||||||
raise callbacks.Error, 'We broke The Google!'
|
raise callbacks.Error, 'Google says: Response Status %s: %s.' % \
|
||||||
|
(json['responseStatus'], json['responseDetails'],)
|
||||||
if fromLang != '':
|
if fromLang != '':
|
||||||
irc.reply(json['responseData']['translatedText'].encode('utf-8'))
|
irc.reply(json['responseData']['translatedText'].encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user