module ExceptionHandling
function divide(a, b) = {{
try {{
return a / b
}} catch (e) {{
println("An error occurred: " + e)
return 0
}}
}}
let a = 10
let b = 0
let result = divide(a, b)
println("Result: " + result)
}
$ golo compile ExceptionHandling.golo
$ golo run ExceptionHandling