File tree 2 files changed +13
-2
lines changed
novelsave/client/bots/discord/endpoints
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
23
23
24
24
### Fixed
25
25
26
- - Fixed discord bot logging format to diagnose errors
26
+ - Fix discord bot logging format to diagnose errors
27
+ - Fix discord bot freezing when encountering error in searching
27
28
28
29
## [ 0.8.1] - 2021-12-13
29
30
Original file line number Diff line number Diff line change @@ -65,7 +65,17 @@ def search(self, word: str):
65
65
logger .debug (f"'{ gateway .name } ' does not support search." )
66
66
return
67
67
68
- novels = gateway .search (word )
68
+ try :
69
+ novels = gateway .search (word )
70
+ except Exception as e :
71
+ logger .exception (e )
72
+ self .session .send_sync (
73
+ mfmt .error (
74
+ f"Encountered error while searching in { gateway .name } : { type (e ).__name__ } "
75
+ )
76
+ )
77
+ continue
78
+
69
79
logger .debug (f"Found { len (novels )} novels in '{ gateway .name } '." )
70
80
for novel in novels :
71
81
self .results .setdefault (novel .title , []).append (novel )
You can’t perform that action at this time.
0 commit comments