From bf6f0e2d18ad053d1375fab446de3d039e399beb Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Sun, 11 Apr 2010 18:27:39 -0400 Subject: [PATCH] make google translate return detailed google error, instead of the unhelpful "we broke google". --- plugins/Google/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 437791cde..8c838185e 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -294,7 +294,8 @@ class Google(callbacks.PluginRegexp): json = simplejson.load(fd) fd.close() 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 != '': irc.reply(json['responseData']['translatedText'].encode('utf-8')) else: