Skip to content

Commit 52910ce

Browse files
authored
Keep original exception when there is an error message (#710)
1 parent b6f951e commit 52910ce

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ public static StreamInfo getInfo(StreamExtractor extractor) throws ExtractionExc
8080
// country.
8181
//
8282
// We will now detect whether the video is blocked by country or not.
83-
String errorMsg = extractor.getErrorMessage();
8483

85-
if (errorMsg != null) {
86-
throw new ContentNotAvailableException(errorMsg);
87-
} else {
84+
final String errorMessage = extractor.getErrorMessage();
85+
if (isNullOrEmpty(errorMessage)) {
8886
throw e;
87+
} else {
88+
throw new ContentNotAvailableException(errorMessage, e);
8989
}
9090
}
9191

0 commit comments

Comments
 (0)