I have a question about the return value of "try expr end".

julia> try 1 == 1 end
true

julia> try 1 == 0 end
false

julia> try error() end
false

I like that "try expr end" returns false if expr throws an error.
Is this a documented feature of "try"?

For exception handling, it's great being able to write "if try e.message == 
"Busy" end ..." where the type of "e" is unknown and may not even have a 
field named "message".

Sam

(Originally asked as part of a longer post to julia-dev, but 
unanswered: 
https://groups.google.com/forum/?fromgroups=#!topic/julia-dev/DQFEhzZcjvQ)

Reply via email to