forked from MarseyWorld/MarseyWorld
better gambling error messages
parent
40045eaa35
commit
1ad2493eab
|
@ -14,7 +14,7 @@ function handleBlackjackResponse(xhr) {
|
||||||
const succeeded = xhr.status >= 200 &&
|
const succeeded = xhr.status >= 200 &&
|
||||||
xhr.status < 300 &&
|
xhr.status < 300 &&
|
||||||
response &&
|
response &&
|
||||||
!response.error;
|
!response.details;
|
||||||
|
|
||||||
clearResult();
|
clearResult();
|
||||||
status = xhr.status;
|
status = xhr.status;
|
||||||
|
@ -28,7 +28,7 @@ function handleBlackjackResponse(xhr) {
|
||||||
updateFeed(response.feed);
|
updateFeed(response.feed);
|
||||||
updatePlayerCurrencies(response.gambler);
|
updatePlayerCurrencies(response.gambler);
|
||||||
} else {
|
} else {
|
||||||
console.error("Error: ", response.error);
|
console.error("Error: ", response.details);
|
||||||
throw new Error("Error")
|
throw new Error("Error")
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -109,7 +109,7 @@ function handleFeedResponse(xhr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const succeeded =
|
const succeeded =
|
||||||
xhr.status >= 200 && xhr.status < 300 && response && !response.error;
|
xhr.status >= 200 && xhr.status < 300 && response && !response.details;
|
||||||
|
|
||||||
if (succeeded) {
|
if (succeeded) {
|
||||||
document.getElementById("casinoGameFeed").dataset.feed = JSON.stringify(response.feed);
|
document.getElementById("casinoGameFeed").dataset.feed = JSON.stringify(response.feed);
|
||||||
|
|
|
@ -364,7 +364,7 @@ function handleRouletteResponse(xhr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const succeeded =
|
const succeeded =
|
||||||
xhr.status >= 200 && xhr.status < 300 && response && !response.error;
|
xhr.status >= 200 && xhr.status < 300 && response && !response.details;
|
||||||
|
|
||||||
if (succeeded) {
|
if (succeeded) {
|
||||||
buildRouletteBets(response.bets);
|
buildRouletteBets(response.bets);
|
||||||
|
|
|
@ -30,7 +30,7 @@ function handleSlotsResponse(xhr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const succeeded =
|
const succeeded =
|
||||||
xhr.status >= 200 && xhr.status < 300 && response && !response.error;
|
xhr.status >= 200 && xhr.status < 300 && response && !response.details;
|
||||||
|
|
||||||
if (succeeded) {
|
if (succeeded) {
|
||||||
const { game_state, gambler } = response;
|
const { game_state, gambler } = response;
|
||||||
|
@ -58,8 +58,8 @@ function handleSlotsResponse(xhr) {
|
||||||
updatePlayerCurrencies(gambler);
|
updatePlayerCurrencies(gambler);
|
||||||
reloadFeed()
|
reloadFeed()
|
||||||
} else {
|
} else {
|
||||||
updateResult(response.error, "danger");
|
updateResult(response.details, "danger");
|
||||||
console.error(response.error);
|
console.error(response.details);
|
||||||
}
|
}
|
||||||
|
|
||||||
enableWager();
|
enableWager();
|
||||||
|
|
|
@ -87,7 +87,7 @@ function handleLotteryResponse(xhr, method, callback) {
|
||||||
const toastMessage = document.getElementById("lottery-post-error-text");
|
const toastMessage = document.getElementById("lottery-post-error-text");
|
||||||
|
|
||||||
toastMessage.innerText =
|
toastMessage.innerText =
|
||||||
(response && response.error) || "Error, please try again later.";
|
(response && response.details) || "Error, please try again later.";
|
||||||
|
|
||||||
bootstrap.Toast.getOrCreateInstance(toast).show();
|
bootstrap.Toast.getOrCreateInstance(toast).show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue