Exceptions
tilttek/journalEvery exception of the library implements Exception\JournalExceptionInterface: catch it to catch them all.
| Exception | Extends | When |
|---|---|---|
Exception\InvalidJournal | InvalidArgumentException | A value out of its shape or its bounds: an identifier, a title, a text, a name, two blocks of one identifier, 200 blocks or 200 mentions, a character or play entry without its subject, a published entry without its time, a negative version, a text that is not UTF-8, a roster empty, too long or holding a person twice, a link pattern without its %s. |
Exception\JournalRefused | DomainException | A call well formed but not allowed: an entry published without blocks or with a block still proposed, a proposed block written into a published entry, a block to accept that the entry does not hold, a secret that is not one of the campaign, a journal of 10 000 entries, a session of more than 200 events, a draft assembled without a source of events. |
Exception\EntryNotFound | RuntimeException | No entry has the identifier; or, for a reader, the entry belongs to another journal, the reader is not in its audience, or it is a draft the reader neither wrote nor runs. |
Exception\JournalConflict | RuntimeException | The entry changed since the version the change was made on: nothing is kept, and the change is made again on the entry read anew. |
The messages name identifiers, never the text of a block or a title. An EntryNotFound raised for a reader reads the
same whether the entry is missing or kept from them.