mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-14 17:37:29 +00:00
fix: narrow catch exception type in ParserCreate.java
Replace 5 instances of `catch (Exception ignored)` with `catch (IllegalStateException ignored)` around matcher.group() calls, since that method only throws IllegalStateException when a named group does not exist.
This commit is contained in:
@@ -81,7 +81,7 @@ public class ParserCreate {
|
|||||||
if (shareKey != null) {
|
if (shareKey != null) {
|
||||||
shareLinkInfo.setShareKey(shareKey);
|
shareLinkInfo.setShareKey(shareKey);
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (IllegalStateException ignored) {}
|
||||||
|
|
||||||
// 提取密码
|
// 提取密码
|
||||||
try {
|
try {
|
||||||
@@ -89,7 +89,7 @@ public class ParserCreate {
|
|||||||
if (StringUtils.isNotEmpty(pwd)) {
|
if (StringUtils.isNotEmpty(pwd)) {
|
||||||
shareLinkInfo.setSharePassword(pwd);
|
shareLinkInfo.setSharePassword(pwd);
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (IllegalStateException ignored) {}
|
||||||
|
|
||||||
// 设置标准URL
|
// 设置标准URL
|
||||||
if (customParserConfig.getStandardUrlTemplate() != null) {
|
if (customParserConfig.getStandardUrlTemplate() != null) {
|
||||||
@@ -133,7 +133,7 @@ public class ParserCreate {
|
|||||||
shareLinkInfo.setSharePassword(pwd);
|
shareLinkInfo.setSharePassword(pwd);
|
||||||
}
|
}
|
||||||
standardUrl = standardUrl.replace("{pwd}", pwd);
|
standardUrl = standardUrl.replace("{pwd}", pwd);
|
||||||
} catch (Exception ignored) {}
|
} catch (IllegalStateException ignored) {}
|
||||||
|
|
||||||
shareLinkInfo.setShareUrl(shareUrl);
|
shareLinkInfo.setShareUrl(shareUrl);
|
||||||
shareLinkInfo.setShareKey(shareKey);
|
shareLinkInfo.setShareKey(shareKey);
|
||||||
@@ -266,14 +266,14 @@ public class ParserCreate {
|
|||||||
if (shareKey != null) {
|
if (shareKey != null) {
|
||||||
shareLinkInfo.setShareKey(shareKey);
|
shareLinkInfo.setShareKey(shareKey);
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (IllegalStateException ignored) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String password = matcher.group("PWD");
|
String password = matcher.group("PWD");
|
||||||
if (password != null) {
|
if (password != null) {
|
||||||
shareLinkInfo.setSharePassword(password);
|
shareLinkInfo.setSharePassword(password);
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (IllegalStateException ignored) {}
|
||||||
|
|
||||||
// 设置标准URL(如果有模板)
|
// 设置标准URL(如果有模板)
|
||||||
if (customConfig.getStandardUrlTemplate() != null) {
|
if (customConfig.getStandardUrlTemplate() != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user