AP_Scripting: Send lua errors to the console before status_text

This helps SITL where we frequently panic about to long a statustext,
which means a user never sees the intresting part unless they comment
out the sanity check, or run on a real board.
This commit is contained in:
Michael du Breuil 2020-01-16 16:49:40 -07:00 committed by WickedShell
parent 56035fa5a1
commit 0e70eabdb9

View File

@ -184,8 +184,8 @@ void lua_scripts::run_next_script(lua_State *L) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: %s exceeded time limit (%d)", script->name, (int)vm_steps);
remove_script(L, script);
} else {
gcs().send_text(MAV_SEVERITY_INFO, "Lua: %s", lua_tostring(L, -1));
hal.console->printf("Lua: Error: %s\n", lua_tostring(L, -1));
gcs().send_text(MAV_SEVERITY_INFO, "Lua: %s", lua_tostring(L, -1));
remove_script(L, script);
}
lua_pop(L, 1);