diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/news/e031_version_0_16_2.rst | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/web/news/e031_version_0_16_2.rst b/web/news/e031_version_0_16_2.rst index ed7352453..6246a33c4 100644 --- a/web/news/e031_version_0_16_2.rst +++ b/web/news/e031_version_0_16_2.rst @@ -25,6 +25,23 @@ 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. + Bugfixes -------- @@ -88,4 +105,5 @@ via a commit, for a full list see - Fixed "Cannot implement distinct seq with setLen" (`#5090 <https://github.com/nim-lang/Nim/issues/5090>`_) - Fixed "await inside array/dict literal produces invalid code" - (`#5314 <https://github.com/nim-lang/Nim/issues/5314>`_) \ No newline at end of file + (`#5314 <https://github.com/nim-lang/Nim/issues/5314>`_) + |