fix: ParserCreate 正则匹配 PWD 组时捕获 IllegalArgumentException

matcher.group(PWD) 在正则未定义 PWD 命名组时抛出
IllegalArgumentException 而非 IllegalStateException,原 catch 未覆盖
导致无提取码的链接(如QQ文件分享)返回 500。
This commit is contained in:
yukaidi
2026-05-29 10:13:22 +08:00
parent c62e109aff
commit 4a0fe61d30

View File

@@ -81,7 +81,7 @@ public class ParserCreate {
if (shareKey != null) {
shareLinkInfo.setShareKey(shareKey);
}
} catch (IllegalStateException ignored) {}
} catch (IllegalStateException | IllegalArgumentException ignored) {}
// 提取密码
try {
@@ -89,7 +89,7 @@ public class ParserCreate {
if (StringUtils.isNotEmpty(pwd)) {
shareLinkInfo.setSharePassword(pwd);
}
} catch (IllegalStateException ignored) {}
} catch (IllegalStateException | IllegalArgumentException ignored) {}
// 设置标准URL
if (customParserConfig.getStandardUrlTemplate() != null) {
@@ -133,7 +133,7 @@ public class ParserCreate {
shareLinkInfo.setSharePassword(pwd);
}
standardUrl = standardUrl.replace("{pwd}", pwd);
} catch (IllegalStateException ignored) {}
} catch (IllegalStateException | IllegalArgumentException ignored) {}
shareLinkInfo.setShareUrl(shareUrl);
shareLinkInfo.setShareKey(shareKey);
@@ -266,14 +266,14 @@ public class ParserCreate {
if (shareKey != null) {
shareLinkInfo.setShareKey(shareKey);
}
} catch (IllegalStateException ignored) {}
} catch (IllegalStateException | IllegalArgumentException ignored) {}
try {
String password = matcher.group("PWD");
if (password != null) {
shareLinkInfo.setSharePassword(password);
}
} catch (IllegalStateException ignored) {}
} catch (IllegalStateException | IllegalArgumentException ignored) {}
// 设置标准URL如果有模板
if (customConfig.getStandardUrlTemplate() != null) {