mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-02-04 04:16:18 +00:00
更新代码和文档
This commit is contained in:
@@ -122,13 +122,23 @@ public class AppMain {
|
||||
if (parser.getBoolean("enabled", false)) {
|
||||
try {
|
||||
String jsCode = parser.getString("jsCode");
|
||||
if (jsCode == null || jsCode.trim().isEmpty()) {
|
||||
log.error("加载演练场解析器失败: {} - JavaScript代码为空", parser.getString("name"));
|
||||
continue;
|
||||
}
|
||||
CustomParserConfig config = JsScriptMetadataParser.parseScript(jsCode);
|
||||
CustomParserRegistry.register(config);
|
||||
loadedCount++;
|
||||
log.info("已加载演练场解析器: {} ({})",
|
||||
config.getDisplayName(), config.getType());
|
||||
} catch (Exception e) {
|
||||
log.error("加载演练场解析器失败: {}", parser.getString("name"), e);
|
||||
String parserName = parser.getString("name");
|
||||
String errorMsg = e.getMessage();
|
||||
log.error("加载演练场解析器失败: {} - {}", parserName, errorMsg, e);
|
||||
// 如果是require相关错误,提供更详细的提示
|
||||
if (errorMsg != null && errorMsg.contains("require")) {
|
||||
log.error("提示:演练场解析器不支持CommonJS模块系统(require),请确保代码使用ES5.1语法");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user