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
This commit is contained in:
P. Christeas 2010-07-09 01:51:41 +03:00
parent 03865bc917
commit e55d772ed1
1 changed files with 3 additions and 2 deletions

View File

@ -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")