Skip to content

Exceptions

tilttek/dice

Every exception of the library implements Tilttek\Dice\Exception\DiceException.

ExceptionRaised whenMessage, for instance
InvalidExpressionAn input or a command of DiceParser does not parse, or names a macro that is not there; input and position say where, reason says whyUnexpected "x" at position 3 of "2d6x".
LimitExceededAn input or a roll goes past a limitThe dice of a roll are limited to 100; this asks for 120.
CannotRollA die is unknown, faces without value enter arithmetic, rolled dice cannot be rolled, @ has no set before it, a text or a list where a number is computed, an item or an instruction that is not there, a rolled count a list or repeat() cannot use, a division by zero, an overflowNo die named "bone" is declared.
InvalidDefinitionA face, a die, a modifier, a validator, a function, a notation, limits, a seed or a commitment is invalid; an unknown dialectThe face "red" is told by its colour alone: give it a shape or an image too.
UntranslatableExpressionThe text of an incomplete translation is asked foravrae cannot write 4dF.