diff --git a/docs/source/exceptions.rst b/docs/source/exceptions.rst index ea65494d..0e6584a2 100644 --- a/docs/source/exceptions.rst +++ b/docs/source/exceptions.rst @@ -52,7 +52,7 @@ Testing in `this closed issue`_ that it doesn't play nice on 64-bit Linux in man Lua and LuaJIT C++ Exception Full Interoperability -------------------------------------------------- -You can ``#define SOL_EXCEPTIONS_SAFE_PROPOGATION`` before including Sol or define ``SOL_EXCEPTIONS_SAFE_PROPOGATION`` on the command line if you know your implmentation of Lua has proper unwinding semantics that can be thrown through the version of the Lua API you have built / are using. +You can ``#define SOL_EXCEPTIONS_SAFE_PROPAGATION`` before including Sol or define ``SOL_EXCEPTIONS_SAFE_PROPAGATION`` on the command line if you know your implmentation of Lua has proper unwinding semantics that can be thrown through the version of the Lua API you have built / are using. This will prevent sol from catching ``(...)`` errors in platforms and compilers that have full C++ exception interoperability. This means that Lua errors can be caught with ``catch (...)`` in the C++ end of your code after it goes through Lua, and exceptions can pass through the Lua API and Stack safely. diff --git a/sol/types.hpp b/sol/types.hpp index 9b36e773..fda0d761 100644 --- a/sol/types.hpp +++ b/sol/types.hpp @@ -57,7 +57,7 @@ namespace sol { catch (const std::exception& e) { lua_pushstring(L, e.what()); } -#if !defined(SOL_EXCEPTIONS_SAFE_PROPOGATION) +#if !defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) catch (...) { lua_pushstring(L, "caught (...) exception"); } @@ -76,7 +76,7 @@ namespace sol { catch (const std::exception& e) { lua_pushstring(L, e.what()); } -#if !defined(SOL_EXCEPTIONS_SAFE_PROPOGATION) +#if !defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) catch (...) { lua_pushstring(L, "caught (...) exception"); }