From 64ed9ffac4069e4d3f62ca0e72cb6f50ab7983cc Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 25 Dec 2009 09:45:25 +0000 Subject: added lua_error --- src/l_log.c | 6 ++++-- src/main_loop.lua | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/l_log.c b/src/l_log.c index fa587b1..d3319cb 100644 --- a/src/l_log.c +++ b/src/l_log.c @@ -66,11 +66,13 @@ static int l_log_print(lua_State *L) else if(!strncmp("DEBUG", prio_str, 6)) prio = DEBUG; else { -// this is an error ... + lua_pushstring(L, "invalid log priority"); + lua_error(L); } } else { -// thist is an error as well + lua_pushstring(L, "invalid log priority"); + lua_error(L); } log_printf(prio, "lua: %s", luaL_checklstring(L, 2, NULL)); diff --git a/src/main_loop.lua b/src/main_loop.lua index e3dfb71..746570e 100644 --- a/src/main_loop.lua +++ b/src/main_loop.lua @@ -27,4 +27,5 @@ log.print("NOTICE", "main_loop started"); log.print("DEBUG", "yet anoter message"); -log.print("ERROR", "this is an error"); \ No newline at end of file +log.print("ERROR", "this is an error"); + -- cgit v1.2.3