[IMP] restrict set of exceptions caught when fetching images

bzr revid: xmo@openerp.com-20110906111226-hx4zh9rjr2fj5sct
This commit is contained in:
Xavier Morel 2011-09-06 13:12:26 +02:00
parent 247cf9886f
commit 6d029a4910
1 changed files with 1 additions and 1 deletions

View File

@ -980,7 +980,7 @@ class Binary(openerpweb.Controller):
else:
res = Model.read([int(id)], [field], context)[0].get(field, '')
image_data = base64.b64decode(res)
except: # TODO: what's the exception here?
except (TypeError, xmlrpclib.Fault):
image_data = self.placeholder(req)
return req.make_response(image_data, [
('Content-Type', 'image/png'), ('Content-Length', len(image_data))])