diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2012-10-23 13:08:43 +0300 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2012-10-23 13:08:43 +0300 |
commit | c615818c97b1e589fb8c634f3cc99039657a90b6 (patch) | |
tree | 69e7a3b1030f7c6521f99d0e12ce717a9dde626b /src/tools.c | |
parent | 1f0c73686741cbabbcd995ffd1db27bcc3a0d0a5 (diff) | |
download | lanes-c615818c97b1e589fb8c634f3cc99039657a90b6.tar.gz lanes-c615818c97b1e589fb8c634f3cc99039657a90b6.tar.bz2 lanes-c615818c97b1e589fb8c634f3cc99039657a90b6.zip |
More informative messages on failed transfers.
Diffstat (limited to 'src/tools.c')
-rw-r--r-- | src/tools.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tools.c b/src/tools.c index c03433a..a9ca956 100644 --- a/src/tools.c +++ b/src/tools.c | |||
@@ -1309,9 +1309,9 @@ int luaG_nameof( lua_State* L) | |||
1309 | /* | 1309 | /* |
1310 | * Push a looked-up native/LuaJIT function. | 1310 | * Push a looked-up native/LuaJIT function. |
1311 | */ | 1311 | */ |
1312 | static void lookup_native_func( lua_State *L2, lua_State *L, uint_t i) | 1312 | static void lookup_native_func( lua_State* L2, lua_State* L, uint_t i) |
1313 | { | 1313 | { |
1314 | char const *fqn; // L // L2 | 1314 | char const* fqn; // L // L2 |
1315 | size_t len; | 1315 | size_t len; |
1316 | _ASSERT_L( L, lua_isfunction( L, i)); // ... f ... | 1316 | _ASSERT_L( L, lua_isfunction( L, i)); // ... f ... |
1317 | STACK_CHECK( L) | 1317 | STACK_CHECK( L) |
@@ -1328,7 +1328,8 @@ static void lookup_native_func( lua_State *L2, lua_State *L, uint_t i) | |||
1328 | lua_pushvalue( L, i); // ... f ... f | 1328 | lua_pushvalue( L, i); // ... f ... f |
1329 | // try to discover the name of the function we want to send | 1329 | // try to discover the name of the function we want to send |
1330 | luaG_nameof( L); // ... f ... "type" "name" | 1330 | luaG_nameof( L); // ... f ... "type" "name" |
1331 | (void) luaL_error( L, "%s %s not found in origin transfer database.", lua_tostring( L, -2), lua_tostring( L, -1)); | 1331 | lua_getglobal( L, "decoda_name"); // ... f ... "type" "name" decoda_name |
1332 | (void) luaL_error( L, "%s '%s' not found in %s origin transfer database.", lua_tostring( L, -3), lua_tostring( L, -2), lua_tostring( L, -1)); | ||
1332 | return; | 1333 | return; |
1333 | } | 1334 | } |
1334 | STACK_END( L, 0) | 1335 | STACK_END( L, 0) |
@@ -1340,7 +1341,9 @@ static void lookup_native_func( lua_State *L2, lua_State *L, uint_t i) | |||
1340 | lua_rawget( L2, -2); // {} f | 1341 | lua_rawget( L2, -2); // {} f |
1341 | if( !lua_isfunction( L2, -1)) | 1342 | if( !lua_isfunction( L2, -1)) |
1342 | { | 1343 | { |
1343 | (void) luaL_error( L, "function %s not found in destination transfer database.", fqn); | 1344 | lua_getglobal( L, "decoda_name"); // // ... f ... decoda_name |
1345 | lua_getglobal( L2, "decoda_name"); // {} f decoda_name | ||
1346 | (void) luaL_error( L, "%s: function '%s' not found in %s destination transfer database.", lua_tostring( L, -1), lua_tostring( L2, -1), fqn); | ||
1344 | return; | 1347 | return; |
1345 | } | 1348 | } |
1346 | lua_remove( L2, -2); // f | 1349 | lua_remove( L2, -2); // f |