From e55d772ed1e2de9ae7d93449993a6b2e78a13e04 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Fri, 9 Jul 2010 01:51:41 +0300 Subject: [PATCH] Document API: meaningful error, when asking for directory data content. Instead of the TypeError, which would be ignored by the FTP implementation, raise an IOError. Conflicts: document/nodes.py bzr revid: p_christ@hol.gr-20100708225141-opsfz22wx6c762nh --- addons/document/nodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 3599b75a15f..a97419cb52a 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -27,6 +27,7 @@ from osv.orm import except_orm import pooler from tools.safe_eval import safe_eval +import errno import os import time @@ -215,7 +216,7 @@ class node_class(object): return False def get_data(self,cr): - raise TypeError('no data for %s'% self.type) + raise IOError(errno.EINVAL, 'no data for %s' % self.type) def open_data(self, cr, mode): """ Open a node_descriptor object for this node. @@ -229,7 +230,7 @@ class node_class(object): For this class, there is no data, so no implementation. Each child class that has data should override this. """ - raise TypeError('no data for %s' % self.type) + raise IOError(errno.EINVAL, 'no data for %s' % self.type) def _get_storage(self,cr): raise RuntimeError("no storage for base class")