Skip to content

Exceptions

tilttek/deck-builder

Every exception of the library implements Tilttek\DeckBuilder\Exception\DeckBuilderException.

ExceptionRaised whenMessage, for instance
InvalidDeckAn identifier, a name, a quantity, a card, a format, a taboo list, a deck or a version is refused, or does not readA deck holds 1 to 999 copies of the card "fox"; 1000 is not.
UnknownFormatThe format catalog does not hold a deck's formatThe format "league" is not in the format catalog.
UnknownDeckA deck, or a version of it, was never savedThe deck "deck-1" has no version 4.
DeckConflictA version saved first by another request, or a copy given an identifier in useThe deck "deck-2" already exists: a copy takes a new identifier.

InvalidDeck extends InvalidArgumentException; the others extend RuntimeException. A deck that breaks its format's rules raises nothing: the validator reports it.