diff --git a/lib/api/twitch_api.dart b/lib/api/twitch_api.dart index c6f7d715..1b10ebeb 100644 --- a/lib/api/twitch_api.dart +++ b/lib/api/twitch_api.dart @@ -227,7 +227,7 @@ class TwitchApi { if (data.isNotEmpty) { return StreamTwitch.fromJson(data.first); } else { - throw Exception('User is offline or does not exist.'); + throw Exception('$userLogin is offline'); } } else { throw Exception('Failed to get stream info.'); diff --git a/lib/screens/channel/stores/video_store.dart b/lib/screens/channel/stores/video_store.dart index 3dfc7f16..84dbfc25 100644 --- a/lib/screens/channel/stores/video_store.dart +++ b/lib/screens/channel/stores/video_store.dart @@ -72,9 +72,11 @@ abstract class _VideoStoreBase with Store { @action Future updateStreamInfo() async { - final updatedStreamInfo = await twitchApi.getStream(userLogin: userLogin, headers: authStore.headersTwitch); - if (updatedStreamInfo != null) { + try { + final updatedStreamInfo = await twitchApi.getStream(userLogin: userLogin, headers: authStore.headersTwitch); _streamInfo = updatedStreamInfo; + } catch (e) { + debugPrint(e.toString()); } }