[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 10:26:41 +02:00
parent a8fa06867b
commit de1fb68444
+2 -4
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