Skip to content

Exceptions

tilttek/exchange

Every exception of the library implements Tilttek\Exchange\Exception\ExchangeException. The exceptions of tilttek/points — InsufficientPoints when a balance does not cover a payment, UnknownCurrency — reach the caller as they are.

ExceptionRaised whenMessage, for instance
InvalidExchangeA key, a reward, a quantity, a reservation, a transfer, an offer, an allowance, a duration or a timezone is refusedAn exchange key is 1 to 200 bytes; this one is 0.
UnknownRewardThe catalogue holds no reward by the codeThe catalogue holds no reward "seat".
UnknownExchangeNo reservation or offer is written under the keyNo offer is written under the key "trade:9".
ExchangeConflictA key already written is given for another reservation, transfer or offerThe key "gift:1" is already written for another transfer.
ExchangeClosedA reservation or an offer is no longer open for the operationThe reservation "order:1" is expired; it cannot be confirmed.
ExchangeRefusedThe rules refuse the exchange; its refusal tells why"member:3" has not been a member long enough to exchange with others.

Refusals

ExchangeRefused::$refusal is a Refusal, for the application to tell the member in its own words:

RefusalMeaning
OutOfStockEvery unit is reserved or delivered
NotYetAvailable, NoLongerAvailableOutside the reward's period
MemberLimitReachedThe member holds as many units as one member may
RequirementUnmetA condition of the reward is not met
SelfExchangeA member exchanging with themselves
NewMemberAn account younger than the delay
AllowanceReachedThe allowance of the period is reached
NotOwnedAn item does not belong to its giver
NotTradableAn item bound to its member
AlreadyHeldAn item held by another open offer
NotPartyA member acting on an offer that is not theirs to act on