Course of Raku / Objects, I/O, and exceptions / Exceptions / Exception objects / Exercises

Prefix the message

Problem

Write a block that does die 'timeout', with a CATCH phaser that prints the caught exception’s message, prefixed with Error:.

Example

The program prints:

Error: timeout

Solution

See the solution

Course navigation

Solution: Match the type   |   Solution: Prefix the message