fix(lua): safe_function_wrapper

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-11-04 18:12:53 -08:00
parent 92b2591a6f
commit f488e6bbfc

View file

@ -9,6 +9,7 @@ Author: Leonardo de Moura
#include <exception> #include <exception>
#include <string> #include <string>
#include "util/exception.h" #include "util/exception.h"
#include "util/debug.h"
namespace lean { namespace lean {
/** /**
@ -40,7 +41,7 @@ int safe_function_wrapper(lua_State * L, lua_CFunction f){
_error_msg = e.what(); _error_msg = e.what();
error_msg = _error_msg.c_str(); error_msg = _error_msg.c_str();
} catch(...) { } catch(...) {
error_msg = "unknown error"; throw;
} }
return luaL_error(L, error_msg); return luaL_error(L, error_msg);
} }