How to skip the error with try/catch statements?

Hi,

Do you know how to try with another option when first doesn’t work?
For example:

try
var = first_option #this variable sometimes works, but in some cases throw an error

#so, when this var throw an error, I want to do other thing.
"other option":
var = second_option

In others words, i want try with an option, but if this option throw me an error, i want to do the second option, that I know its work. I hope you understand me.

var = try
   sqrt(-1)
catch
    1
end
2 Likes