mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-02-08 13:35:10 +08:00
AP_Scripting: Add support for enums to be passed through
This commit is contained in:
committed by
Randy Mackay
parent
6e7367b86f
commit
0054544bd3
@@ -69,16 +69,21 @@ lua_scripts::script_info *lua_scripts::load_script(lua_State *L, char *filename)
|
||||
switch (error) {
|
||||
case LUA_ERRSYNTAX:
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Syntax error in %s", filename);
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Error: %s", lua_tostring(L, -1));
|
||||
lua_pop(L, lua_gettop(L));
|
||||
return nullptr;
|
||||
case LUA_ERRMEM:
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Insufficent memory loading %s", filename);
|
||||
lua_pop(L, lua_gettop(L));
|
||||
return nullptr;
|
||||
case LUA_ERRFILE:
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Unable to load the file: %s", lua_tostring(L, -1));
|
||||
hal.console->printf("Lua: File error: %s\n", lua_tostring(L, -1));
|
||||
lua_pop(L, lua_gettop(L));
|
||||
return nullptr;
|
||||
default:
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Unknown error (%d) loading %s", error, filename);
|
||||
lua_pop(L, lua_gettop(L));
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user