From 01782dc5c201351343f94a1d521adc55458f60cd Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 13 Nov 2016 04:09:26 -0500 Subject: [PATCH] [ci skip] here we go --- docs/source/errors.rst | 2 +- docs/source/exceptions.rst | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/source/errors.rst b/docs/source/errors.rst index 6df78c99..5088c09e 100644 --- a/docs/source/errors.rst +++ b/docs/source/errors.rst @@ -10,7 +10,7 @@ Catch and CRASH! By default, Sol will add a ``default_at_panic`` handler. If exceptions are not turned off, this handler will throw to allow the user a chance to recover. However, in almost all cases, when Lua calls ``lua_atpanic`` and hits this function, it means that something *irreversibly wrong* occured in your code or the Lua code and the VM is in an unpredictable or dead state. Catching an error thrown from the default handler and then proceeding as if things are cleaned up or okay is NOT the best idea. Unexpected bugs in optimized and release mode builds can result, among other serious issues. -It is preferred if you catch an error that you log what happened, terminate the Lua VM as soon as possible, and then crash if your application cannot handle spinning up a new Lua state. Catching can be done, but you should understand the risks of what you're doing when you do it. For more information about catching exceptions, the potentials, not turning off exceptions and other tricks and caveats, read about :doc:`exceptions in Sol here`. +It is preferred if you catch an error that you log what happened, terminate the Lua VM as soon as possible, and then crash if your application cannot handle spinning up a new Lua state. Catching can be done, but you should understand the risks of what you're doing when you do it. For more information about catching exceptions, the potentials, not turning off exceptions and other tricks and caveats, read about :doc:`exceptions in Sol here`. Lua is a C API first and foremost: exceptions bubbling out of it is essentially last-ditch, terminal behavior that the VM does not expect. You can see an example of handling a panic on the exceptions page :ref:`here`. diff --git a/docs/source/exceptions.rst b/docs/source/exceptions.rst index 955f3e7f..ea65494d 100644 --- a/docs/source/exceptions.rst +++ b/docs/source/exceptions.rst @@ -49,8 +49,6 @@ It is important to note that a popular 5.1 distribution of Lua, LuaJIT, has some Testing in `this closed issue`_ that it doesn't play nice on 64-bit Linux in many cases either, especially when it hits an error internal to the interpreter (and does not go through Sol). We do have tests, however, that compile for our continuous integration check-ins that check this functionality across several compilers and platforms to keep you protected and given hard, strong guarantees for what happens if you throw in a function bound by Sol. If you stray outside the realm of Sol's protection, however... Good luck. -.. _LuaJIT C++ Exception Full Interoperability - Lua and LuaJIT C++ Exception Full Interoperability --------------------------------------------------