From 29b5c1374311d2599ff499dd366da727b6c08e8c Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Thu, 29 Mar 2018 04:49:02 +0800 Subject: [PATCH] fix: dev: search bookmarks --- bukuserver/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bukuserver/server.py b/bukuserver/server.py index 5331409..dcdc1a7 100644 --- a/bukuserver/server.py +++ b/bukuserver/server.py @@ -333,7 +333,12 @@ def search_bookmarks(): else: pagination_total = len(result['bookmarks']) bms = list(chunks(result['bookmarks'], per_page)) - result['bookmarks'] = bms[page-1] + 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