mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Give the user error messages from the server.
Helps with https://github.com/ajayyy/SponsorBlockServer/pull/70
This commit is contained in:
@@ -218,9 +218,12 @@ async function submitTimes(videoID: string, callback) {
|
|||||||
+ "&userID=" + userID, function(xmlhttp, error) {
|
+ "&userID=" + userID, function(xmlhttp, error) {
|
||||||
if (xmlhttp.readyState == 4 && !error) {
|
if (xmlhttp.readyState == 4 && !error) {
|
||||||
callback({
|
callback({
|
||||||
statusCode: xmlhttp.status
|
statusCode: xmlhttp.status,
|
||||||
|
responseText: xmlhttp.responseText
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (xmlhttp.status == 200) {
|
if (xmlhttp.status == 200) {
|
||||||
//save the amount contributed
|
//save the amount contributed
|
||||||
if (!increasedContributionAmount) {
|
if (!increasedContributionAmount) {
|
||||||
|
|||||||
@@ -1467,7 +1467,7 @@ function sendSubmitMessage(){
|
|||||||
document.getElementById("submitButton").style.animation = "unset";
|
document.getElementById("submitButton").style.animation = "unset";
|
||||||
(<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
|
(<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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user