mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 03:56:21 +05:30
Handle server-side session error for /admin/autosave
This commit is contained in:
parent
a0b8059647
commit
60858703c0
2 changed files with 10 additions and 1 deletions
|
|
@ -1132,6 +1132,8 @@ post('/admin/autosave', function () {
|
|||
}
|
||||
header('Content-Type: application/json');
|
||||
echo $response;
|
||||
} else {
|
||||
error(401, "Not logged in");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,14 @@ function updateData() {
|
|||
}, 6000);
|
||||
},
|
||||
error: function(response) {
|
||||
$("#response-error").html("Error in Autosaving: " + response.statusText);
|
||||
var httpError = "";
|
||||
if (response.status !== 0) {
|
||||
httpError += ": " + response.status;
|
||||
if (response.responseText) {
|
||||
httpError += " " + response.responseText;
|
||||
}
|
||||
}
|
||||
$("#response-error").html("Error in Autosaving: " + response.statusText + httpError);
|
||||
$("#response-error").fadeIn(600, function() {
|
||||
$("#response-error").css("display", "block");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue