Fixes #3691.
This commit is contained in:
parent
e8c46d29cd
commit
3cbfd56e1d
4 changed files with 41 additions and 19 deletions
|
|
@ -25,3 +25,19 @@ Compiler Additions
|
|||
Language Additions
|
||||
------------------
|
||||
|
||||
- The ``try`` statement's ``except`` branches now support the binding of a
|
||||
caught exception to a variable:
|
||||
|
||||
.. code-block:: nim
|
||||
try:
|
||||
raise newException(Exception, "Hello World")
|
||||
except Exception as exc:
|
||||
echo(exc.msg)
|
||||
|
||||
This replaces the ``getCurrentException`` and ``getCurrentExceptionMsg()``
|
||||
procedures, although these procedures will remain in the stdlib for the
|
||||
foreseeable future. This new language feature is actually implemented using
|
||||
these procedures.
|
||||
|
||||
In the near future we will be converting all exception types to refs to
|
||||
remove the need for the ``newException`` template.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue