better gambling error messages

master
Aevann 2023-08-08 20:06:03 +03:00
parent 40045eaa35
commit 1ad2493eab
5 changed files with 8 additions and 8 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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();
}