From b8fc11116d3b543c8dafceb6c84bb4daf29dd727 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Fri, 8 Apr 2011 12:38:57 +0530 Subject: [PATCH] [IMP] sync_google_calendar: Raised a proper error message if user has no access rights. bzr revid: uco@tinyerp.com-20110408070857-e77tdgrd4dr93d2e --- addons/google_base_account/wizard/google_login.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/google_base_account/wizard/google_login.py b/addons/google_base_account/wizard/google_login.py index 21e5700e3d0..fe362488666 100644 --- a/addons/google_base_account/wizard/google_login.py +++ b/addons/google_base_account/wizard/google_login.py @@ -75,8 +75,12 @@ class google_login(osv.osv_memory): 'gmail_password': password } self.pool.get('res.users').write(cr, uid, uid, res, context=context) - except : - raise osv.except_osv(_('Error'), _("Authentication fail check the user and password !")) + except Exception, e: + if len(e.args) > 1: + msg = e.args[1] + else: + msg = e.args[0] + raise osv.except_osv(_('Error'), _("%s" %msg)) return self._get_next_action(cr, uid, context=context)