Skip to content

Commit

Permalink
fix: improve error handling on details page
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanYuuki committed Feb 5, 2025
1 parent 3f77c75 commit c8ad256
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/screens/manga/details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ class _MangaDetailsPageState extends State<MangaDetailsPage> {
await _mapToService();
}
} catch (e) {
snackBar("Ooops! Looks like we ran into an error, try again please",
duration: 2000);
if (e.toString().contains("dynamic")) {
_fetchAnilistData();
}
snackBar("Retrying!, $e", duration: 2000);
}
}

Expand Down Expand Up @@ -166,8 +168,10 @@ class _MangaDetailsPageState extends State<MangaDetailsPage> {

setState(() {});
} catch (e) {
snackBar("Ooops! Looks like we ran into an error, try again please",
duration: 2000);
if (e.toString().contains("dynamic")) {
_fetchSourceDetails(media);
}
snackBar("Retrying!, $e", duration: 2000);
}
}

Expand Down

0 comments on commit c8ad256

Please sign in to comment.