This is probably not the best fix, but my journey into LuaJIT
ends here, at least for now.
// an exception_ptr was pushed on the stack
// rethrowing it with an additional ExecutionErrorException
try {
- std::rethrow_exception(readTopAndPop<std::exception_ptr>(state, std::move(errorCode)));
+ if (const auto exp = readTopAndPop<std::exception_ptr>(state, std::move(errorCode))) {
+ std::rethrow_exception(exp);
+ }
} catch(...) {
std::throw_with_nested(ExecutionErrorException{"Exception thrown by a callback function called by Lua"});
}
+ throw ExecutionErrorException{"Unknown Lua error"};
}
}
}