Give the user error messages from the server.

Helps with https://github.com/ajayyy/SponsorBlockServer/pull/70
This commit is contained in:
Ajay Ramachandran
2020-04-04 23:47:01 -04:00
parent 93f82de7fd
commit 93c0a0c003
2 changed files with 5 additions and 2 deletions

View File

@@ -218,9 +218,12 @@ async function submitTimes(videoID: string, callback) {
+ "&userID=" + userID, function(xmlhttp, error) {
if (xmlhttp.readyState == 4 && !error) {
callback({
statusCode: xmlhttp.status
statusCode: xmlhttp.status,
responseText: xmlhttp.responseText
});
if (xmlhttp.status == 200) {
//save the amount contributed
if (!increasedContributionAmount) {

View File

@@ -1467,7 +1467,7 @@ function sendSubmitMessage(){
document.getElementById("submitButton").style.animation = "unset";
(<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
alert(utils.getErrorMessage(response.statusCode));
alert(utils.getErrorMessage(response.statusCode) + "\n\n" + response.responseText);
}
}
});