You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.6 KiB
Go

package session
import sharederrors "knowfoolery/backend/shared/domain/errors"
var (
// ErrSessionNotFound indicates the requested session does not exist.
ErrSessionNotFound = sharederrors.New(sharederrors.CodeNotFound, "session not found")
// ErrSessionExpired indicates the session exceeded allowed duration.
ErrSessionExpired = sharederrors.New(sharederrors.CodeSessionExpired, "session expired")
// ErrSessionNotActive indicates session mutations are not allowed in current state.
ErrSessionNotActive = sharederrors.New(sharederrors.CodeSessionNotActive, "session is not active")
// ErrGameInProgress indicates a player already has an active session.
ErrGameInProgress = sharederrors.New(sharederrors.CodeGameInProgress, "active session already exists")
// ErrMaxAttemptsReached indicates current question has exhausted attempts.
ErrMaxAttemptsReached = sharederrors.New(sharederrors.CodeMaxAttemptsReached, "max attempts reached")
// ErrHintAlreadyUsed indicates the hint is already consumed for current question.
ErrHintAlreadyUsed = sharederrors.New(sharederrors.CodeConflict, "hint already used")
// ErrForbidden indicates caller is not authorized for this session.
ErrForbidden = sharederrors.New(sharederrors.CodeForbidden, "forbidden")
// ErrInvalidState indicates session or question state is invalid for operation.
ErrInvalidState = sharederrors.New(sharederrors.CodeValidationFailed, "invalid session state")
// ErrRapidAnswer indicates anti-cheat latency guard rejected the answer.
ErrRapidAnswer = sharederrors.New(sharederrors.CodeForbidden, "answer submitted too quickly")
)