From 5e162a28f7ebca879b9ee522e2d13543a1620383 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 1edafa76c..edd9f829b 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -278,7 +278,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: