mirror of
https://gitcode.com/JianFeeeee/LuaCangjia_api.git
synced 2026-09-22 18:08:07 +00:00
对齐c层与cj层错误码,修改测试以配合c层更新
This commit is contained in:
@ -72,7 +72,7 @@ public class LuaError <: Exception {
|
||||
match (code) {
|
||||
case 5001 => "JSON file load failed"
|
||||
case 5002 => "Memory allocation failed"
|
||||
case 5003 => "File load error (permission or path issue)"
|
||||
case 5003 => "File load error (path, permission, or compile-time syntax issue)"
|
||||
case 5004 => "Script runner initialization failed"
|
||||
case 5005 => "Lua state machine initialization failed or corrupted"
|
||||
case 5006 => "JSON parse error (format issue)"
|
||||
@ -91,7 +91,7 @@ public class LuaError <: Exception {
|
||||
case 5019 => "Reset input file failed, may cause input pollution"
|
||||
case 5020 => "Error in callback functions"
|
||||
case 5021 => "change workdir error"
|
||||
case 5022 => "Calling func no found"
|
||||
case 5022 => "No callable chunk found"
|
||||
case _ => "Unknown error"
|
||||
}
|
||||
}
|
||||
@ -192,9 +192,9 @@ public class LuaRunner {
|
||||
/// 运行Lua脚本
|
||||
///
|
||||
/// @param path 脚本路径
|
||||
/// @param arg 传递给脚本的参数
|
||||
/// @param arg 传递给脚本的单参数;管道模式下由底层按栈布局自动计算调用参数数量
|
||||
/// @return 脚本执行结果字符串
|
||||
/// @throws LuaError 当脚本运行出错时抛出
|
||||
/// @throws LuaError 当脚本编译或运行出错时抛出
|
||||
public func runScript(path: String, arg: String): String {
|
||||
let pathPtr = toCStr(path)
|
||||
let argPtr = toCStr(arg)
|
||||
|
||||
Reference in New Issue
Block a user