diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-07-09 01:51:41 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-07-09 01:51:41 +0300 |
| commit | e55d772ed1e2de9ae7d93449993a6b2e78a13e04 (patch) | |
| tree | fb6b13e12a3b7205a269e8a8400ffb3843ee26ce /addons/document/nodes.py | |
| parent | 03865bc917b6fa7ee3e3964411722ccdc75b52c2 (diff) | |
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
Diffstat (limited to 'addons/document/nodes.py')
| -rw-r--r-- | addons/document/nodes.py | 5 |
1 files 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") |
