Skip to content

Exceptions

tilttek/predictions

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

ExceptionThrown whenMessage
QuestionClosedA prediction once the question is closed, a cancellation once it is resolved, a resolution once it is cancelled or resolved otherwise, a settlement before it is resolvedThe question "…" takes no more predictions., The question "…" is resolved: it can no longer be cancelled or resolved otherwise., The question "…" is cancelled: it can no longer be resolved., The question "…" is not resolved yet: there is nothing to settle.
UnknownQuestionNo question is asked under the keyNo question is asked under the key "…".
InvalidPredictionA key, an outcome, a pick, points, a setting or a read out of bounds; a pick that does not fit its question; a question asked again differently or closing in the pastWhat is out of bounds, and the bound

QuestionClosed and UnknownQuestion extend DomainException; InvalidPrediction extends InvalidArgumentException.

The exceptions of tilttek/points reach the caller unchanged: MovementConflict when a prediction's key is written in the ledger for other points.