[FIX] google_calendar: fix error type

The call to delete_an_event calls the method _do_request, which will
throw a urllib2.HTTPError.

opw-652219
This commit is contained in:
Nicolas Martinelli 2015-10-16 09:52:42 +02:00
parent a8fa06867b
commit de1fb68444
1 changed files with 2 additions and 4 deletions

View File

@ -875,11 +875,9 @@ class google_calendar(osv.AbstractModel):
if actSrc == 'GG':
try:
self.delete_an_event(cr, uid, current_event[0], context=context)
except Exception, e:
error = simplejson.loads(e.read())
error_nr = error.get('error', {}).get('code')
except urllib2.HTTPError, e:
# if already deleted from gmail or never created
if error_nr in (404, 410,):
if e.code in (404, 410,):
pass
else:
raise e