From 479f4ca6a3d02a85eb26243403ada518b341f430 Mon Sep 17 00:00:00 2001 From: Manav Date: Thu, 20 Feb 2020 19:46:19 +0530 Subject: Fixed non-working examples in Manual: Exception Handling (#13424) --- doc/manual.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/manual.rst b/doc/manual.rst index b31458fc4..ba13f2f02 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -4106,6 +4106,8 @@ needs to fit the types of ``except`` branches, but the type of the ``finally`` branch always has to be ``void``: .. code-block:: nim + from strutils import parseInt + let x = try: parseInt("133a") except: -1 finally: echo "hi" @@ -4220,7 +4222,7 @@ Raise statement Example: .. code-block:: nim - raise newEOS("operating system failed") + raise newException(IOError, "IO failed") Apart from built-in operations like array indexing, memory allocation, etc. the ``raise`` statement is the only way to raise an exception. -- cgit 1.4.1-2-gfad0