[IMP] restrict set of exceptions caught when fetching images
bzr revid: xmo@openerp.com-20110906111226-hx4zh9rjr2fj5sct
This commit is contained in:
parent
247cf9886f
commit
6d029a4910
|
@ -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))])
|
||||
|
|
Loading…
Reference in New Issue