Exceptions
tilttek/character-sheetEvery exception of the library implements Exception\CharacterSheetException: catch it to catch them all.
| Exception | Extends | When |
|---|---|---|
Exception\InvalidSheet | InvalidArgumentException | A value out of its shape or its bounds: an identifier, a name, a key, an attribute, a level, an item or its bonuses, too many items, campaigns or fields, a field value, charges at once, an adjustment, rules of another system, rules out of their bounds, a pool that is not a derived value, two rules of one system. |
Exception\InvalidFormula | InvalidArgumentException | A formula that cannot be read, beyond its bounds, reading a name the rules do not hold, or in a loop with others; or one that cannot be computed: a name without value, a division by zero, a value beyond its bounds, clamp with its bounds upside down. |
Exception\SheetRefused | DomainException | A change not allowed on the sheet as it is: an attribute missing or not of the system, a value beyond its bounds, a level beyond the rules, an item unknown, a value that is not a pool, more charges than are left, a campaign joined twice or not joined, a value the computed sheet does not hold. |
Exception\SheetNotFound | RuntimeException | No sheet has the identifier, or no rules are known for its system. |
Exception\SheetConflict | RuntimeException | The sheet changed since it was read, or a new one has the identifier of a kept one: the change is not kept, and is made again on what is read anew. |