Files
LuaCangjia_api/lib/errors.h
2026-03-18 16:20:46 +08:00

25 lines
1.5 KiB
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef ERRORS
#define ERRORS
//用于定义napi中所有可能出现的错误便于错误传递
#define NAPI_JSON_LOAD_FAIL 5001 //json文件加载错误
#define NAPI_MALLOC_FAIL 5002 //内存分配错误
#define NAPI_LOAD_FILE_ERROR 5003 //文件加载错误,可能为权限或路径问题
#define NAPI_SCRIPT_RUNNER_INVALID 5004 //脚本运行器初始化错误,脚本运行器异常
#define NAPI_LUA_STATE_ERROR 5005 //lua状态机初始化错误或损坏
#define NAPI_JSON_RESOLVE_FAIL 5006 //json解析错误可能为格式错误等
#define NAPI_JSON_FORMATE_ERROR 5007 //json格式错误与mcp常见格式不符)
#define NAPI_MISSING_JSON_ARG 5008 //无法从json中解析到参数
#define NAPI_LUA_STACK_NOSPACE 5009 //lua状态机栈空间不足
#define NAPI_SCRIPT_ERROR 5010 //脚本内部错误,取result获取更多信息
#define NAPI_SCRIPT_BAD_RET 5011 //脚本返回值错误
#define NAPI_UNLOADLIB_FAIL 5012 // 释放的库未被加载
#define NAPI_LUAFUN_NOFOUND 5013 //调用不符合规定,没有遵守单入参单出参约定
#define NAPI_LUA_STACK_ERROR 5014 //函数调用时,栈大小小于约定最小大小
#define NAPI_LUA_INITFAIL 5015 //lua状态机初始化错误
#define NAPI_LUALIB_LOAD_OVER_STACK 5016 //加载太多lib
#define NAPI_LUA_CLASS_LOST 5017 //luarunner对象丢失
#define NAPI_LUA_MISS_REDIRECT 5018 //漏传用于重定向的文件路径
#define NAPI_RESET_INPUT_FILE_ERROR 5019 //重置输入文件失败,可能造成输入污染
#define NAPI_ERROR_FUNCS 5020
#endif