NAME
Game::Senet::Error - why a move, a record or a position was refused
VERSION
Version 0.02
SYNOPSIS
$game->play('12-15') or print $game->error->code, ': ', $game->error->message, "\n";
DESCRIPTION
A refusal: a code a program can switch on, an English sentence a terminal can show, and the detail of what was asked. A game that refuses a move returns undef and keeps one of these in error.
CODES
In the order a move is asked about them: game_over, bad_move, no_roll, no_piece, not_your_piece, bound_piece, wrong_distance, forward_first, no_back, must_land_26, no_exit, blockade, own_piece, safe_house, protected. And bad_record for a record that disagrees with the game it describes, bad_position for a position a game cannot start from.
METHODS
of
my $error = Game::Senet::Error->of($code, %detail);
The refusal with that code. A code that is not one croaks.
code
message
detail
A hash: the throw, the roll, the houses, the ply, as the refusal had them.
codes
Every code, in order.
message_for
my $sentence = Game::Senet::Error->message_for($code);
AUTHOR
LNATION <email@lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION <email@lnation.org>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)