diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2017-02-01 21:11:40 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2017-02-01 21:11:40 +0100 |
commit | 3cbfd56e1d02f30124a15db6104ac5d7ffbbbea3 (patch) | |
tree | cd7311f068784571014b36e66f47ff7656a6debe /web | |
parent | e8c46d29cdfa604bf13294bc3505938fc243754d (diff) | |
download | Nim-3cbfd56e1d02f30124a15db6104ac5d7ffbbbea3.tar.gz |
Fixes #3691.
Diffstat (limited to 'web')
-rw-r--r-- | web/news/e031_version_0_16_2.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/news/e031_version_0_16_2.rst b/web/news/e031_version_0_16_2.rst index 4d9d99d16..225324c3a 100644 --- a/web/news/e031_version_0_16_2.rst +++ b/web/news/e031_version_0_16_2.rst @@ -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. |