Course of Raku / Functional, concurrent, reactive, and web programming / Reactive programming / await / Exercises

Await a failure

Problem

When a promise’s block throws, await rethrows that exception at the point of the await. Start a promise whose block does die 'boom'. Await it inside a try block with a CATCH phaser that prints caught: <message>.

Example

The program prints:

caught: boom

Solution

See the solution

Course navigation

Solution: Await a supply   |   Solution: Await a failure