Skip to content

Exceptions

tilttek/reference-tables

Every exception of the library implements Exception\ReferenceTablesException: catch it to catch them all.

ExceptionExtendsRaised when
InvalidTableInvalidArgumentExceptionA table, column, row, cell or range breaks a rule; a modifier, a value entered, a query or a limit is out of its bounds.
InvalidDocumentInvalidArgumentExceptionA document cannot be read; the message starts with the place of the field.
UnknownTableOutOfBoundsExceptionA catalogue holds no table of the key, a table no column, or a row no cell in the column.
UnknownRowOutOfBoundsExceptionA table holds no row of the key, or no range covers the value.
LookupRefusedLogicExceptionA key is asked of a table looked up by range, a value of one looked up by key, a table without a die is rolled, a cell is read as another kind, or a die gives no number.

Some messages:

The table "armor" has no row "chain".
No row of the table "reaction" covers 13.
The table "reaction" is looked up by range, not by key.
The table "weather" has no die to roll.
The rows "1–5" and "5–6" of the table "wandering" overlap.
"high" is not a range such as "12", "3–5", "21+" or "≤0".
tables[0].rows[2].value: a whole number is expected.

A die or a cell rolled beyond the limits of the DiceRoller raises the DiceException of tilttek/dice.