From dd500b34b7687c45ad3f263ca9046f226a288a0a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 4 Aug 2015 18:49:43 +0200 Subject: [PATCH] [FIX] google_calendar: log google bad requests reason For debugging easyness. For instance, when trying to sync an event with an attendee with a wrong email, google failed, it's wasn't easy to know why from the logs It is now a bit easier. opw-646369 --- addons/google_account/google_account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/google_account/google_account.py b/addons/google_account/google_account.py index 2cc56d0cba4..ea1482d6925 100644 --- a/addons/google_account/google_account.py +++ b/addons/google_account/google_account.py @@ -163,13 +163,13 @@ class google_service(osv.osv_memory): except: pass except urllib2.HTTPError, e: - if e.code in (400, 401, 410): - raise e - elif e.code in (204, 404): + if e.code in (204, 404): status = e.code response = "" else: _logger.exception("Bad google request : %s !" % e.read()) + if e.code in (400, 401, 410): + raise e raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong with your request to google"), context=context) return (status, response, ask_time)