From e406ba094cf8aa81e9af5c9dfa1187e66c38005f Mon Sep 17 00:00:00 2001 From: mauriciocolli Date: Fri, 17 Mar 2017 12:09:20 -0300 Subject: [PATCH] Improve bug detection - Show a message with the appropriate error (network error) --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 7d6345a8a..95ce2e69c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -818,6 +818,15 @@ public class PopupVideoPlayer extends Service implements StateInterface { }); } }); + } catch (IOException ie) { + if (DEBUG) ie.printStackTrace(); + mainHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(PopupVideoPlayer.this, R.string.network_error, Toast.LENGTH_SHORT).show(); + } + }); + stopSelf(); } catch (Exception e) { if (DEBUG) e.printStackTrace(); mainHandler.post(new Runnable() {