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