class X::Phaser::PrePost

Error due to a false return value of a PRE/POST phaser
class X::Phaser::PrePost is Exception { }

Thrown when the condition inside a PRE or POST phaser evaluate to a false value.

For example

sub f($x) { PRE { $x ~~ Int } };
    f "foo";
    CATCH { default { put .^name, ': ', .Str } };
    # OUTPUT: X::Phaser::PrePost: Precondition '{ $x ~~ Int }' failed«␤»

Methods

method phaser

method phaser(--> Str:D)

Returns the name of the failed phaser, "PRE" or "POST".

method condition

method condition(--> Str:D)

Returns the part of the source code that describes the phaser condition.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.