NAME

Game::Floppy::Error - a refused flap, returned rather than thrown

VERSION

Version 0.10

SYNOPSIS

$game->flap or do {
    my $error = $game->error;
    print $error->code;       # already_flapped
    print $error->message;    # one flap a tick
};

DESCRIPTION

Game::Floppy refuses a flap by returning 0 and keeping one of these where "error" in Game::Floppy can find it. Nothing is thrown. The codes are not_active and already_flapped.

METHODS

of

Builds the error for a code. An unknown code is a programmer error and dies.

code, message, error

The code, its sentence, and 1.

codes, messages

Every code, and every code with its sentence.

stringify

The code and the sentence, joined with a colon.

AUTHOR

LNATION, <email at lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2024 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)