"The catch clause is not strictly necessary; when omitted, the default 
return value is nothing."
Ref: http://docs.julialang.org/en/latest/manual/control-flow/#exception-handling

On Wednesday, August 12, 2015 at 3:14:51 PM UTC+2, Yichao Yu wrote:
>
> On Wed, Aug 12, 2015 at 9:03 AM, Sisyphuss <[email protected] 
> <javascript:>> 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