Adds some documentation related to exceptions.

This commit is contained in:
Grzegorz Adam Hankiewicz 2013-01-21 21:43:34 +01:00
commit acc394ca23
2 changed files with 31 additions and 0 deletions

View file

@ -433,6 +433,20 @@ handled, it is propagated through the call stack. This means that often
the rest of the procedure - that is not within a ``finally`` clause -
is not executed (if an exception occurs).
If you need to *access* the actual exception object or message inside an
``except`` branch you can use the getCurrentException() and
getCurrentExceptionMsg() procs from the `system <system.html>`_ module.
Example:
.. code-block:: nimrod
try:
doSomethingHere()
except:
let
e = getCurrentException()
msg = getCurrentExceptionMsg()
echo "Got exception ", repr(e), " with message ", msg
Exception hierarchy
-------------------