浏览代码

Fix LUA error reporting

Signed-off-by: DL6ER <dl6er@dl6er.de>
DL6ER 9 月之前
父节点
当前提交
e0cd57edd1
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/mod_lua.inl

+ 6 - 2
src/mod_lua.inl

@@ -673,7 +673,9 @@ run_lsp_kepler(struct mg_connection *conn,
 
 
 	} else {
 	} else {
 		/* Success loading chunk. Call it. */
 		/* Success loading chunk. Call it. */
-		lua_pcall(L, 0, 0, 1);
+		lua_ok = lua_pcall(L, 0, 0, 0);
+		if(lua_ok != LUA_OK)
+			lua_cry(conn, lua_ok, L, "LSP", "call");
 	}
 	}
 	return 0;
 	return 0;
 }
 }
@@ -789,7 +791,9 @@ run_lsp_civetweb(struct mg_connection *conn,
 						lua_pcall(L, 1, 0, 0);
 						lua_pcall(L, 1, 0, 0);
 					} else {
 					} else {
 						/* Success loading chunk. Call it. */
 						/* Success loading chunk. Call it. */
-						lua_pcall(L, 0, 0, 1);
+						lua_ok = lua_pcall(L, 0, 0, 0);
+						if(lua_ok != LUA_OK)
+							lua_cry(conn, lua_ok, L, "LSP", "call");
 					}
 					}
 
 
 					/* Progress until after the Lua closing tag. */
 					/* Progress until after the Lua closing tag. */