Skip to content

Exceptions

tilttek/wargame-army

Every exception of the library implements Tilttek\WargameArmy\Exception\WargameArmyException.

ExceptionRaised whenMessage, for instance
InvalidCatalogueA unit, an option, a group, a detachment type, a slot, a constraint or a catalogue is refused, or does not readThe group "weapon" has two options "sword".
InvalidArmyListAn army list, a detachment or a unit selection holds a value out of its bounds, or does not readThe models of a unit is from 1 to 1000; 0 is not.
UnknownCatalogueThe application does not provide a list's catalogueThe catalogue "ember-vale" is not provided.

InvalidCatalogue and InvalidArmyList extend InvalidArgumentException; UnknownCatalogue extends RuntimeException. A list that breaks its catalogue's rules raises nothing: the validator reports it.