Skip to content

Commit

Permalink
- Display index name on error message when index can't be used as
Browse files Browse the repository at this point in the history
       'sort_on'.

     - PUT would fail if the created object had a __len__ = 0 (eg:
       BTreeFolder2) and fallback to _default_put_factory. Fix by
       checking if the returned object is None instead.
  • Loading branch information
sidnei committed Apr 26, 2004
1 parent 731beec commit b6a9777
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Catalog.py
Expand Up @@ -735,12 +735,12 @@ def _getSortIndex(self, args):
# self.indexes is always a dict, so get() w/ 1 arg works
sort_index = self.indexes.get(sort_index_name)
if sort_index is None:
raise CatalogError, 'Unknown sort_on index'
raise CatalogError, 'Unknown sort_on index (%s)' % sort_index_name
else:
if not hasattr(sort_index, 'keyForDocument'):
raise CatalogError(
'The index chosen for sort_on is not capable of being'
' used as a sort index.'
'The index chosen for sort_on (%s) is not capable of being'
' used as a sort index.' % sort_index_name
)
return sort_index
else:
Expand Down

0 comments on commit b6a9777

Please sign in to comment.