On Wed, Aug 12, 2015 at 9:03 AM, Sisyphuss <[email protected]> wrote:
> I thought the following code will return the value 1,
> a = try
>     error()
> finally
>     1
> end

No, the try block doesn't even return because it throws an error. To
get a return value when an error happens, use the catch block.

> However, `a` is undefined, as oppose to the `b` in the following code
> b = try
>     error()
> end
> defined as `nothing`.
>

Reply via email to