fix: dev: catch IndexError
This commit is contained in:
parent
b3d678fc7c
commit
93bb1f108c
@ -85,7 +85,12 @@ def bookmarks():
|
||||
current_app.logger.debug('per page:{}'.format(per_page))
|
||||
pagination_total = len(result['bookmarks'])
|
||||
bms = list(chunks(result['bookmarks'], per_page))
|
||||
try:
|
||||
result['bookmarks'] = bms[page-1]
|
||||
except IndexError as err:
|
||||
current_app.logger.debug('{}:{}, result bookmarks:{}, page:{}'.format(
|
||||
type(err), err, len(result['bookmarks']), page
|
||||
))
|
||||
pagination = Pagination(
|
||||
page=page, total=pagination_total, per_page=per_page,
|
||||
search=False, record_name='bookmarks', bs_version=3
|
||||
|
Loading…
Reference in New Issue
Block a user