added exception handling, updated client
This commit is contained in:
@@ -673,6 +673,7 @@ Operation.prototype.execute = function(arg1, arg2, arg3, arg4, parent) {
|
||||
var obj = {
|
||||
url: url,
|
||||
method: this.method,
|
||||
body: args.body,
|
||||
useJQuery: this.useJQuery,
|
||||
headers: headers,
|
||||
on: {
|
||||
@@ -1318,7 +1319,12 @@ ShredHttpClient.prototype.execute = function(obj) {
|
||||
if(contentType != null) {
|
||||
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
|
||||
if(response.content.data && response.content.data !== "")
|
||||
out.obj = JSON.parse(response.content.data);
|
||||
try{
|
||||
out.obj = JSON.parse(response.content.data);
|
||||
}
|
||||
catch (e) {
|
||||
// unable to parse
|
||||
}
|
||||
else
|
||||
out.obj = {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user