Overview
| Artifact ID: | 2fe04cc3851c58164e6605878c8b90687afaa045 |
|---|---|
| Ticket: | bfe0f34e6ca558c525d3d649f93970e2267b5ff1
catch and yieldto |
| User & Date: | ferrieux on 2017-06-05 09:29:52 |
Changes
- icomment:
Hum, misread the output. Resumption of the coro floor doesn't really restore the error context, it just gets a stale errorstack. My bad. So the workaround is different: to get that distal error you must catch the distal coro floor from the "synchronous invocation" that starts the yieldto chain, which is either the initial one or a resumption: % coroutine coro3 apply {{} { yield;error CORO3}} % coroutine coro2 apply {{} { yield;yieldto coro3}} % catch {coroutine coro1 apply {{} { yieldto coro2}}} e;puts CAUGHT:$e CAUGHT:CORO3 % coroutine coro3 apply {{} { yield;error CORO3}} % coroutine coro2 apply {{} { yield;yieldto coro3}} % coroutine coro1 apply {{} {yield;yieldto coro2}} % catch coro1 e;puts CAUGHT:$e CAUGHT:CORO3 - login: "ferrieux"
- mimetype: "text/plain"