diff --git a/paginate/__init__.py b/paginate/__init__.py index 7b9d9a1..52e2c3a 100644 --- a/paginate/__init__.py +++ b/paginate/__init__.py @@ -259,7 +259,7 @@ def __init__( first = (self.page - 1) * items_per_page last = first + items_per_page self.items = list(self.collection[first:last]) - except TypeError: + except (KeyError, TypeError) as exc: raise TypeError( "Your collection of type {} cannot be handled " "by paginate.".format(type(self.collection))