Use Exception instead of Throwable (more consistent)

This commit is contained in:
Stypox 2019-08-27 13:16:08 +02:00 committed by Tobias Groza
parent db3596c818
commit 35921345d9

View File

@ -66,14 +66,14 @@ public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor
if (match.matches()) { if (match.matches()) {
return YoutubeChannelExtractor.CHANNEL_URL_BASE + match.group(1); return YoutubeChannelExtractor.CHANNEL_URL_BASE + match.group(1);
} }
} catch(Throwable ignored) {} } catch(Exception ignored) {}
try { try {
// fallback method just in case youtube changes things; it should never run and tests will fail // fallback method just in case youtube changes things; it should never run and tests will fail
// provides an url with "/user/NAME", that is inconsistent with stream and channel extractor // provides an url with "/user/NAME", that is inconsistent with stream and channel extractor
return el.select("a[class*=\"yt-uix-tile-link\"]").first() return el.select("a[class*=\"yt-uix-tile-link\"]").first()
.attr("abs:href"); .attr("abs:href");
} catch (Throwable e) { } catch (Exception e) {
throw new ParsingException("Could not get channel url", e); throw new ParsingException("Could not get channel url", e);
} }
} }