Added better error messages to voting.

This commit is contained in:
Ajay Ramachandran
2019-07-29 21:06:15 -04:00
parent 366fd43752
commit 0d0b919106
3 changed files with 17 additions and 6 deletions

View File

@@ -710,8 +710,13 @@ function vote(type, UUID) {
//failure: duplicate vote
addLoadingInfo("It seems you've already voted before", UUID)
} else if (response.successType == -1) {
//failure: duplicate vote
addLoadingInfo("A connection error has occured.", UUID)
if (response.statusCode == 502) {
addLoadingInfo("It seems the sever is down. Contact the dev immediately.", UUID)
} else {
//failure: unknown error
addLoadingInfo("A connection error has occured. Error code: " + response.statusCode, UUID)
}
}
}
});