File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 12
12
from calibre .gui2 .dialogs .match_books_ui import Ui_MatchBooks
13
13
from calibre .utils .icu import sort_key
14
14
from calibre .utils .localization import ngettext
15
+ from calibre .utils .search_query_parser import ParseException
15
16
16
17
17
18
class TableItem (QTableWidgetItem ):
@@ -134,7 +135,11 @@ def do_search(self):
134
135
try :
135
136
self .search_button .setEnabled (False )
136
137
QApplication .setOverrideCursor (QCursor (Qt .CursorShape .WaitCursor ))
137
- books = self .library_db .data .search (query , return_matches = True )
138
+ try :
139
+ books = self .library_db .data .search (query , return_matches = True )
140
+ except ParseException as e :
141
+ return error_dialog (self .gui , _ ('Could not search' ), _ (
142
+ 'The search expression {} is not valid.' ).format (query ), det_msg = str (e ), show = True )
138
143
self .books_table .setRowCount (len (books ))
139
144
140
145
self .books_table .setSortingEnabled (False )
You can’t perform that action at this time.
0 commit comments