Adding error message for unauthenticated access.

This commit is contained in:
marcins78@gmail.com
2011-10-19 23:49:43 +00:00
parent 8bb2e49976
commit c869613fb9
2 changed files with 12 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ var ChatBoxUI = Class.extend({
this.div = div;
this.communication = new GempLotrCommunication(url, function(xhr, ajaxOptions, thrownError) {
if (thrownError != "abort") {
if (xhr != null) {
if (xhr.status == 401) {
that.appendMessage("Chat problem - You're not logged in, go to the <a href='index.html'>main page</a> to log in", "warningMessage");
return;
}
}
that.appendMessage("Chat had a problem communicating with the server, no new messages will be displayed, but your messages still might get sent.", "warningMessage");
that.appendMessage("Reload the browser page (press F5) to resume the chat.", "warningMessage");
}

View File

@@ -13,6 +13,12 @@ var GempLotrHallUI = Class.extend({
this.div = div;
this.comm = new GempLotrCommunication(url, function(xhr, ajaxOptions, thrownError) {
if (thrownError != "abort") {
if (xhr != null) {
if (xhr.status == 401) {
chat.appendMessage("Game hall problem - You're not logged in, go to the <a href='index.html'>main page</a> to log in", "warningMessage");
return;
}
}
chat.appendMessage("The game hall had a problem communicating with the server, no new updates will be displayed.", "warningMessage");
chat.appendMessage("Reload the browser page (press F5) to resume the game hall functionality.", "warningMessage");
}