switch popErrorCode Basic errors case ERR001 return new InvalidRemoveS

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
switch (popErrorCode) {
// Basic errors
case "ERR001":
return new InvalidRemoveService();
case "ERR002":
return new InvalidGamingPlatform();
case "ERR003":
return new Errors.MerchantInternalError();
case "ERR004":
return new IncompleteRequest();
case "ERR007":
return new UnknownRequest();
case "ERR022":
return new PopPlayerSessionExpiredError();
case "ERR025":
return new InsufficientBalance();
case "ERR026":
return new PlayerAccountBlocked();
case "ERR027":
return new WagetLimitExceeded();
case "ERR028":
return new TransactionFailed();
case "ERR029":
return new UnsupportedGame();
case "ERR031":
return new Errors.MerchantInternalError();
case "ERR034":
return new GameCycleNotExist();
case "ERR035":
return new InvalidPlayerSessionParams();
case "ERR036":
return new IncorrectPlayerIdOrToken();
case "ERR037":
return new Errors.InsufficientBalanceError();
case "ERR043":
case "ERR1022":
return new CancelTransactionNotExist();
case "ERR044":
case "ERR1023":
return new BetTransactionAlreadyCanceled();
case "ERR1001":
return new PermissionDenied();
case "ERR1003":
return new RGMaxBetExceededForBonusMoneyError(
popErrorMessage,
POPExtraData.getExtraDataFromResponse(response, PopupButtonGameActions.refresh)
).dontTranslate();
case "ERR1004":
return new SessionExpired();
case "ERR1005":
return new PlayerIsSelfExcludedError(popErrorMessage)
.setExtraData(popErrorExtraDataStore.getPlayerIsSelfExcludedExtraData());
case "ERR1006":
return new TableSessionNotFound();
case "ERR1007":
return new CantOpenRetailGame();
case "ERR1008":
return new CantEndSessionWithNoBets();
case "ERR1009":
return new InvalidUserNameOrPassword();
case "ERR1010":
return new PlayerAlreadyLoggedIn();
case "ERR1011":
return new TooManyLoginAttempts();
case "ERR1012":
return new InvalidPin();
case "ERR1016":
return new GamePlayBlockedByWallet();
case "ERR2001":
return new Errors.RGSessionLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2002":
return new Errors.RGDailyLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2003":
return new Errors.RGWeeklyLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2004":
return new Errors.RGMonthlyLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2005":
return new Errors.RGSessionBetLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2006":
return new Errors.RGDailyBetLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2007":
return new Errors.RGWeeklyBetLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2008":
return new Errors.RGMonthlyBetLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2009":
return new Errors.RGWithdrawLimitReachedError();
case "ERR2010":
return new Errors.RGMandatoryLimitMissingError();
case "ERR2011":
return new Errors.RGSessionGameGroupLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2012":
return new Errors.RGDailyGameGroupLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2013":
return new Errors.RGWeeklyGameGroupLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2014":
return new Errors.RGMonthlyGameGroupLossLimitReachedError(popErrorMessage, getBetLossErrorExtraData(response));
case "ERR2015":
return new Errors.RGRegulatoryCustomError(popErrorMessage);
case "ERR2210": // UK
return new Errors.RGRealityCheckError(popErrorMessage,
popErrorExtraDataStore.getUKRealityCheckExtraData(
noContinuePlayButtonForRealityCheck(response)))
.dontTranslate();
case "ERR2211": // Malta - can come as reality check or as expired session timer
return new Errors.RGRealityCheckError(safeGet(response, "data", "message") || popErrorMessage,
popErrorExtraDataStore.getMaltaRealityCheckExtraData(
noContinuePlayButtonForRealityCheck(response),
isSessionTimerMessage(popErrorMessage)))
.dontTranslate();
case "ERR2212":
return new PlayerIsSelfExcludedError(popErrorMessage)
.setExtraData(popErrorExtraDataStore.getPlayerIsSelfExcludedExtraData());
case "ERR2213":
return new CoolDownTimerActive();
default:
return undefined;
}