mirror of
https://github.com/h7x4/Jisho-Study-Tool.git
synced 2024-12-21 13:37:29 +01:00
Add error check for kanji search
This commit is contained in:
parent
9633693c9b
commit
e254d128a3
@ -23,7 +23,8 @@ class KanjiBloc extends Bloc<KanjiEvent, KanjiState> {
|
||||
|
||||
try {
|
||||
final _kanji = await fetchKanji(event.kanjiSearchString);
|
||||
yield KanjiSearchFinished(kanji: _kanji);
|
||||
if (_kanji.found) yield KanjiSearchFinished(kanji: _kanji);
|
||||
else yield KanjiSearchError('Something went wrong');
|
||||
} on Exception {
|
||||
yield KanjiSearchError('Something went wrong');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user