nodejs: message about error on json parse

This commit is contained in:
Sergey Linnik
2016-08-04 11:37:47 +03:00
parent 150ce6d8d4
commit eab18cbd1d

View File

@ -161,7 +161,11 @@ if (typeof jQuery != "undefined") {
url: requestAddress,
complete: function (data) {
var responseText = data.responseText;
var response = jq.parseJSON(responseText);
try {
var response = jq.parseJSON(responseText);
} catch (e) {
response = { error: e };
}
if (response.error) {
jq(".current").removeClass("current");
jq(".step:not(.done)").addClass("error");