Skip to content

Commit

Permalink
Update re-api error message
Browse files Browse the repository at this point in the history
  • Loading branch information
John Fitzgerald committed Dec 11, 2024
1 parent c1fc809 commit 6d0d537
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,22 @@ function fetchDone(data) {
if (!data.aircraft || !data.now) {
let error = data.error;
if (error) {
jQuery("#update_error_detail").text(error);

const errorParts = error.split(":");
const errorCode = errorParts[0].trim();
const errorMessage = errorParts[1] ? errorParts[1].trim() : "Unknown error";

let additionalMessage = "";

if (errorCode === "401") {
additionalMessage = " Please refresh the browser to continue.";
} else if (errorCode === "403") {
additionalMessage = " reCAPTCHA validation failed.";
}

const displayMessage = errorMessage + additionalMessage;

jQuery("#update_error_detail").text(displayMessage);
jQuery("#update_error").css('display','block');
StaleReceiverCount++;
}
Expand Down

0 comments on commit 6d0d537

Please sign in to comment.