Skip to content

Exceptions

tilttek/points

Every exception of the library implements Tilttek\Points\Exception\PointsException.

ExceptionRaised whenMessage, for instance
InvalidPointsAn account, a currency, a lifetime, a key, an amount, a rule, a cap, a timezone, a read or a batch size is refused"Stars" is not a currency code: 1 to 32 lower-case letters, digits and "_", starting with a letter.
MovementConflictA key already written is written again for another movementThe movement key "gift:1" is already written for another movement.
InsufficientPointsA spending or a transfer is larger than the payer's balanceThe account "member:member:44" holds 30 points; 31 cannot be paid from it.
UnknownCurrencyA currency is asked for by a code none hasNo currency of points is named "crowns".
UnknownMovementA refund names no spendingNo spending is written under the key "order:2".

The verb patterns and the context conditions of a rule are checked by tilttek/activity, which raises its own InvalidActivity.