summaryrefslogtreecommitdiff
path: root/src/lib/elua/elua.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elua/elua.c')
-rw-r--r--src/lib/elua/elua.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index f4411ae1e9..2f88e7be02 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -62,6 +62,24 @@ elua_shutdown(void)
62 return _elua_init_counter; 62 return _elua_init_counter;
63} 63}
64 64
65static void
66_elua_errmsg(const char *pname, const char *msg)
67{
68 ERR("%s%s%s", pname ? pname : "", pname ? ": " : "", msg);
69}
70
71EAPI int
72elua_report_error(lua_State *L, const char *pname, int status)
73{
74 if (status && !lua_isnil(L, -1))
75 {
76 const char *msg = lua_tostring(L, -1);
77 _elua_errmsg(pname, msg ? msg : "(non-string error)");
78 lua_pop(L, 1);
79 }
80 return status;
81}
82
65static int 83static int
66_elua_gettext_bind_textdomain(lua_State *L) 84_elua_gettext_bind_textdomain(lua_State *L)
67{ 85{