mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-23 11:53:48 +01:00
- Catch save exception is the object is not JSON
This commit is contained in:
parent
7b1574150a
commit
6badd972b0
@ -46,7 +46,13 @@ mindplot.RESTPersistenceManager = new Class({
|
|||||||
},
|
},
|
||||||
onFailure:function (xhr) {
|
onFailure:function (xhr) {
|
||||||
var responseText = xhr.responseText;
|
var responseText = xhr.responseText;
|
||||||
events.onError(JSON.decode(responseText));
|
var error = null;
|
||||||
|
try {
|
||||||
|
error = JSON.decode(responseText);
|
||||||
|
} catch (e) {
|
||||||
|
throw "Unexpected error saving. Error response is not json object:" + responseText;
|
||||||
|
}
|
||||||
|
events.onError(error);
|
||||||
},
|
},
|
||||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||||
emulation:false,
|
emulation:false,
|
||||||
|
Loading…
Reference in New Issue
Block a user