Skip to content

Exceptions

tilttek/dice-bundle

The bundle raises the library's exceptions, which implement Tilttek\Dice\Exception\DiceException, and two of its own:

ExceptionRaised whenMessage
Application\Exception\UnknownRollreplay() names a roll the journal does not holdNo recorded roll has the identifier "…".
Application\Exception\InvalidMacrodefine() gets a name that is not one, or a level the shelves give no owner forThe shelves give no owner for the level "member".
Tilttek\Dice\Exception\InvalidExpressionAn input does not parse, names a macro that is not there, or a macro that does not parse or names itselfNo macro is named "sword" at position 2 of "1+$sword".
Tilttek\Dice\Exception\LimitExceededAn input or a roll goes past a limit; an input expands too many macrosThe macros an input expands are limited to 32; this asks for 35.
Tilttek\Dice\Exception\CannotRollAn unknown die, faces without value in arithmetic, a division by zeroNo die named "bone" is declared.
Tilttek\Dice\Exception\InvalidDefinitionA configured face, die or notation is invalid, when the container is compiled; an unknown dialectTwo faces of the die "coin" share an identifier.

UnknownRoll and InvalidMacro implement DiceException too. The Twig filters catch the library's exceptions: dice_notation gives the input back, dice_dialect gives null.