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