From 52910ce970a4787c6cb98fb856a380b15ebe0910 Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 13 Aug 2021 16:13:58 +0200 Subject: [PATCH] Keep original exception when there is an error message (#710) --- .../org/schabi/newpipe/extractor/stream/StreamInfo.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java index 12affe4d..665ed598 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java @@ -80,12 +80,12 @@ public class StreamInfo extends Info { // country. // // We will now detect whether the video is blocked by country or not. - String errorMsg = extractor.getErrorMessage(); - if (errorMsg != null) { - throw new ContentNotAvailableException(errorMsg); - } else { + final String errorMessage = extractor.getErrorMessage(); + if (isNullOrEmpty(errorMessage)) { throw e; + } else { + throw new ContentNotAvailableException(errorMessage, e); } }