Skip to content

Exceptions

tilttek/secret-rolls

Every exception of the library implements Tilttek\SecretRolls\Exception\SecretRollsException. roll() also lets the exceptions of tilttek/dice through: InvalidExpression, LimitExceeded and CannotRoll.

ExceptionRaised whenMessage, for instance
InvalidSecretRollA scene, a roller or a context is refused, or an opening, a hidden roll, a journal entry or a journal does not readA scene is 1 to 128 letters, digits, dots, colons, underscores or hyphens.
SecretRollRefusedA roll in a closed or full scene, the reveal of a roll the scene never committed, revealed already or no longer sealed, or a second closingThe roll 3f2a… was revealed already; a roll is revealed once.
JournalConflictAn entry does not come at the position after the last one of its scene: two writers appended at onceThe journal of the scene cave expects position 4; an entry came at position 3.

InvalidSecretRoll extends InvalidArgumentException, SecretRollRefused extends DomainException and JournalConflict extends RuntimeException.