From 0e70eabdb9d9f29d86bc976b69c0da1d6fe8c0b4 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Thu, 16 Jan 2020 16:49:40 -0700 Subject: [PATCH] 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. --- libraries/AP_Scripting/lua_scripts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Scripting/lua_scripts.cpp b/libraries/AP_Scripting/lua_scripts.cpp index 596f611d78..9ed3859fb5 100644 --- a/libraries/AP_Scripting/lua_scripts.cpp +++ b/libraries/AP_Scripting/lua_scripts.cpp @@ -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);