Skip to content

Exceptions

tilttek/math-trade

Every exception of the library implements Exception\MathTradeException: catch this one to catch them all.

ExceptionThrown whenMessage
InvalidTradeListAn identifier out of bounds, two participants or offers with one identifier, a participant without offers, a wish for itself, for nobody's offer, for its own participant's offer or for one offer twice, a group of fewer than two, limits out of their bounds, a JSON document that is not a trade list of the format, an offer looked up that nobody makesWhat is wrong, naming the participant, the offer or the key
LimitExceededA list or a JSON document larger than its Limits allowThe limit that was passed, such as The trade list holds more than 5000 offers.
InvalidSeedA seed empty, longer than 256 bytes, not UTF-8, or holding a control characterA seed is 1 to 256 bytes of UTF-8 without a control character.

InvalidTradeList and InvalidSeed extend InvalidArgumentException; LimitExceeded extends LengthException.

The messages name the application's identifiers, which the participant who wrote the list knows: an application may show them to that participant as they are.