julia异常捕获处理示例代码

代码语言:julia

所属分类:其他

代码描述:julia异常捕获处理示例代码

代码标签: 处理 示例

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

# try, catch can be used to deal with errors as with many other languages
try
    push!(a,1)
catch err
    showerror(stdout, err, backtrace());println()
end
#> UndefVarError: a not defined
#> Stacktrace:
#>  [1] top-level scope at C:\JuliaByExample\src\error_handling.jl:5
#>  [2] include at .\boot..........完整代码请登录后点击上方下载按钮下载查看

网友评论0