[med-svn] [aghermann] 18/31: report lua errors to applog
andrei zavada
hmmr-guest at alioth.debian.org
Sun Nov 10 00:34:17 UTC 2013
This is an automated email from the git hooks/post-receive script.
hmmr-guest pushed a commit to branch WIP
in repository aghermann.
commit 15f28e42797dcefb22fa46a06c941d34a0190f90
Author: Andrei Zavada <hmmr at ra>
Date: Sat Nov 9 20:43:23 2013 +0200
report lua errors to applog
---
upstream/src/aghermann/rk1968/rk1968.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/upstream/src/aghermann/rk1968/rk1968.cc b/upstream/src/aghermann/rk1968/rk1968.cc
index b34c8e5..ab8bb0e 100644
--- a/upstream/src/aghermann/rk1968/rk1968.cc
+++ b/upstream/src/aghermann/rk1968/rk1968.cc
@@ -201,10 +201,12 @@ host_get_data( lua_State *L)
auto& E = *this_p->sepisodep;
int opcode = lua_tointeger( L, 2);
+
auto make_arity_mismatch_return = [&L, &nargsin, &opcode] ( int correct_nargsin)
{
lua_pushboolean( L, false);
- lua_pushfstring( L, "Bad arity for opcode %d (need %d or more, got %d)", opcode, correct_nargsin, nargsin);
+ APPLOG_WARN ("Bad arity for opcode %d (need %d, got %d)", opcode, correct_nargsin, nargsin);
+ lua_pushfstring( L, "Bad arity for opcode %d (need %d, got %d)", opcode, correct_nargsin, nargsin);
lua_error(L);
};
auto make_error_return = [&L] ( const char* fmt, ...) __attribute__ ((format (printf, 2, 3)))
@@ -212,7 +214,9 @@ host_get_data( lua_State *L)
lua_pushboolean( L, false);
va_list ap;
va_start (ap, fmt);
- lua_pushvfstring( L, fmt, ap);
+ string E = agh::str::svasprintf( fmt, ap);
+ APPLOG_WARN ("%s", E.c_str());
+ lua_pushstring( L, E.c_str());
va_end (ap);
lua_error(L);
};
--
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git
More information about the debian-med-commit
mailing list