Exceptions/Catch an exception thrown in a nested call: Difference between revisions

Line 2,074:
val .U1 = h{"msg": "U1"}
 
val .baz = ffn(.i) throw if(.i==0: .U0; .U1)
val .bar = ffn(.i) .baz(.i)
 
val .foo = fimpure fn() {
for .i in [0, 1] {
.bar(.i)
catch {
if _err["'msg"] == .U0["'msg"] {
writeln "caught .U0 in .foo()"
} else {
Line 2,090:
}
 
.foo()</syntaxhighlight>
</syntaxhighlight>
 
{{out}}
885

edits