aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools.c b/src/tools.c
index 9961c1a..0fcb2f1 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -538,7 +538,11 @@ lua_State* luaG_newstate( lua_State* _from, int const _on_state_create, char con
538 luaG_inter_move( _from, L, 1); 538 luaG_inter_move( _from, L, 1);
539 STACK_END( _from, 0); 539 STACK_END( _from, 0);
540 } 540 }
541 lua_call( L, 0, 0); 541 // capture error and forward it to main state
542 if( lua_pcall( L, 0, 0, 0) != LUA_OK)
543 {
544 luaL_error( _from, "on_state_create failed: \"%s\"", lua_isstring( L, -1) ? lua_tostring( L, -1) : lua_typename( L, lua_type( L, -1)));
545 }
542 STACK_MID( L, 0); 546 STACK_MID( L, 0);
543 } 547 }
544 548