[YouTube] Do not catch every exception on getErrorMessage
@B0pol suggestion
This commit is contained in:
parent
3191bd6c70
commit
68d23defba
1 changed files with 5 additions and 4 deletions
|
@ -612,10 +612,11 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
@Override
|
@Override
|
||||||
public String getErrorMessage() {
|
public String getErrorMessage() {
|
||||||
try {
|
try {
|
||||||
return getTextFromObject(initialAjaxJson.getObject(2).getObject("playerResponse").getObject("playabilityStatus")
|
return getTextFromObject(initialAjaxJson.getObject(2).getObject("playerResponse")
|
||||||
.getObject("errorScreen").getObject("playerErrorMessageRenderer").getObject("reason"));
|
.getObject("playabilityStatus").getObject("errorScreen")
|
||||||
} catch (Exception e) {
|
.getObject("playerErrorMessageRenderer").getObject("reason"));
|
||||||
return null;
|
} catch (ParsingException | NullPointerException e) {
|
||||||
|
return null; // no error message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue