Jump to content

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

Line 1,847:
val .bar = f(.i) .baz(.i)
 
val .foo = f(.i) {
.bar(for .i) in [0, 1] {
catch if .err["msg"] == .U0["msg"] {bar(.i)
writelncatch "caughtif .U0err["msg"] in== .foo()U0["msg"] {
writeln "caught .U0 in .foo()"
} else {
throw} .errelse {
throw
} else { }
}
}
 
.foo(0)</lang>
.foo(1)</lang>
 
{{out}}
973

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.