paginator: report better expcetions

This commit is contained in:
RhodeCode Admin 2023-03-05 18:47:26 +01:00
parent a55db736a0
commit 35791c850a

View file

@ -295,10 +295,10 @@ class _Page(list):
first = (self.page - 1) * items_per_page
last = first + items_per_page
self.items = list(self.collection[first:last])
except TypeError:
except TypeError as err:
raise TypeError(
"Your collection of type {} cannot be handled "
"by paginate.".format(type(self.collection))
"by paginate. ERROR:{}".format(type(self.collection), err)
)
# Unless the user tells us how many items the collections has