Juliaにおける例外処理
try-catchブロック
finallyブロック
code:exception-handling.jl
function mySqrt(x)
try
sqrt(x)
catch e # エラーの内容が格納される
println(typeof(e))
if e isa DomainError
sqrt(Complex(x))
else
throw(e) # エラーを現在のスコープから外部のスコープに伝えられる
end
finally # 例外の有無に関わらず実行するコード
println("Done")
end
end