handle ContentNotSupportedException in BaseStateFragment

thus not supported soundcloud streams (e.g. hls streams) don't crash
anyore
This commit is contained in:
bopol 2020-03-30 12:38:42 +02:00
parent 36b2bea25f
commit cc7a25d9ce
5 changed files with 8 additions and 1 deletions

View file

@ -20,6 +20,7 @@ import org.schabi.newpipe.MainActivity;
import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
@ -216,6 +217,9 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
} else if (exception instanceof IOException) {
showError(getString(R.string.network_error), true);
return true;
} else if (exception instanceof ContentNotSupportedException) {
showError(getString(R.string.content_not_supported), false);
return true;
}
return false;