Standardise API error response format

This commit is contained in:
Nick O'Leary
2015-03-30 14:16:04 +01:00
parent 7adefd6ee0
commit 2a8a885271
9 changed files with 24 additions and 26 deletions

View File

@@ -148,7 +148,7 @@ RED.deploy = (function() {
}).fail(function(xhr,textStatus,err) {
RED.nodes.dirty(true);
if (xhr.responseText) {
RED.notify("<strong>Error</strong>: "+xhr.responseText,"error");
RED.notify("<strong>Error</strong>: "+xhr.responseJSON.message,"error");
} else {
RED.notify("<strong>Error</strong>: no response from server","error");
}

View File

@@ -330,7 +330,7 @@ RED.library = (function() {
}).done(function(data,textStatus,xhr) {
RED.notify("Saved "+options.type,"success");
}).fail(function(xhr,textStatus,err) {
RED.notify("Saved failed: "+xhr.responseText,"error");
RED.notify("Saved failed: "+xhr.responseJSON.message,"error");
});
}
$( "#node-dialog-library-save-confirm" ).dialog({