[IMP] sync_google_calendar: Raised a proper error message if user has no access rights.

bzr revid: uco@tinyerp.com-20110408070857-e77tdgrd4dr93d2e
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-04-08 12:38:57 +05:30
parent 31729c526c
commit b8fc11116d
1 changed files with 6 additions and 2 deletions

View File

@ -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)