Skip to content

Commit b30ae76

Browse files
committed
bug 12492
-Fix error handling for list view actions -Add error handlers for all Configuration section actions/data calls status 12492: resolved fixed
1 parent 254e839 commit b30ae76

2 files changed

Lines changed: 79 additions & 9 deletions

File tree

‎ui/scripts/configuration.js‎

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@
154154
success: function(json) {
155155
var item = json.createserviceofferingresponse.serviceoffering;
156156
args.response.success({data: item});
157+
},
158+
error: function(data) {
159+
args.response.error(parseXMLHttpResponse(data));
157160
}
158161
});
159162
},
@@ -177,6 +180,9 @@
177180
actionFitler: serviceOfferingActionfilter,
178181
data:items
179182
});
183+
},
184+
error: function(data) {
185+
args.response.error(parseXMLHttpResponse(data));
180186
}
181187
});
182188
},
@@ -196,6 +202,9 @@
196202
success: function(json) {
197203
var item = json.updateserviceofferingresponse.serviceoffering;
198204
args.response.success({data: item});
205+
},
206+
error: function(data) {
207+
args.response.error(parseXMLHttpResponse(data));
199208
}
200209
});
201210
}
@@ -218,6 +227,9 @@
218227
async: true,
219228
success: function(json) {
220229
args.response.success();
230+
},
231+
error: function(data) {
232+
args.response.error(parseXMLHttpResponse(data));
221233
}
222234
});
223235
},
@@ -438,6 +450,9 @@
438450
success: function(json) {
439451
var item = json.createserviceofferingresponse.serviceoffering;
440452
args.response.success({data: item});
453+
},
454+
error: function(data) {
455+
args.response.error(parseXMLHttpResponse(data));
441456
}
442457
});
443458
},
@@ -458,6 +473,9 @@
458473
success: function(json) {
459474
var items = json.listserviceofferingsresponse.serviceoffering;
460475
args.response.success({data:items});
476+
},
477+
error: function(data) {
478+
args.response.error(parseXMLHttpResponse(data));
461479
}
462480
});
463481
},
@@ -477,6 +495,9 @@
477495
success: function(json) {
478496
var item = json.updateserviceofferingresponse.serviceoffering;
479497
args.response.success({data: item});
498+
},
499+
error: function(data) {
500+
args.response.error(parseXMLHttpResponse(data));
480501
}
481502
});
482503
}
@@ -499,6 +520,9 @@
499520
async: true,
500521
success: function(json) {
501522
args.response.success();
523+
},
524+
error: function(data) {
525+
args.response.error(parseXMLHttpResponse(data));
502526
}
503527
});
504528
},
@@ -594,6 +618,9 @@
594618
success: function(json) {
595619
var items = json.listdiskofferingsresponse.diskoffering;
596620
args.response.success({data:items});
621+
},
622+
error: function(data) {
623+
args.response.error(parseXMLHttpResponse(data));
597624
}
598625
});
599626
},
@@ -687,6 +714,9 @@
687714
success: function(json) {
688715
var item = json.creatediskofferingresponse.diskoffering;
689716
args.response.success({data: item});
717+
},
718+
error: function(data) {
719+
args.response.error(parseXMLHttpResponse(data));
690720
}
691721
});
692722
},
@@ -714,6 +744,9 @@
714744
success: function(json) {
715745
var item = json.updatediskofferingresponse.diskoffering;
716746
args.response.success({data: item});
747+
},
748+
error: function(data) {
749+
args.response.error(parseXMLHttpResponse(data));
717750
}
718751
});
719752
}
@@ -736,6 +769,9 @@
736769
async: true,
737770
success: function(json) {
738771
args.response.success();
772+
},
773+
error: function(data) {
774+
args.response.error(parseXMLHttpResponse(data));
739775
}
740776
});
741777
},
@@ -818,6 +854,9 @@
818854
actionFilter: networkOfferingActionfilter,
819855
data:items
820856
});
857+
},
858+
error: function(data) {
859+
args.response.error(parseXMLHttpResponse(data));
821860
}
822861
});
823862
},
@@ -876,6 +915,10 @@
876915
data: data.createnetworkofferingresponse.networkoffering,
877916
actionFilter: networkOfferingActionfilter
878917
});
918+
},
919+
920+
error: function(data) {
921+
args.response.error(parseXMLHttpResponse(data));
879922
}
880923
});
881924
},
@@ -950,6 +993,9 @@
950993
})
951994
)
952995
});
996+
},
997+
error: function(data) {
998+
args.response.error(parseXMLHttpResponse(data));
953999
}
9541000
});
9551001
}
@@ -999,6 +1045,9 @@
9991045
args.response.success({
10001046
fields: fields
10011047
});
1048+
},
1049+
error: function(data) {
1050+
args.response.error(parseXMLHttpResponse(data));
10021051
}
10031052
});
10041053
}
@@ -1041,6 +1090,9 @@
10411090
success: function(json) {
10421091
var item = json.updatenetworkofferingresponse.networkoffering;
10431092
args.response.success();
1093+
},
1094+
error: function(data) {
1095+
args.response.error(parseXMLHttpResponse(data));
10441096
}
10451097
});
10461098
},
@@ -1071,6 +1123,9 @@
10711123
success: function(json) {
10721124
var item = json.updatenetworkofferingresponse.networkoffering;
10731125
args.response.success();
1126+
},
1127+
error: function(data) {
1128+
args.response.error(parseXMLHttpResponse(data));
10741129
}
10751130
});
10761131
},
@@ -1091,6 +1146,9 @@
10911146
},
10921147
success: function(json) {
10931148
args.response.success();
1149+
},
1150+
error: function(data) {
1151+
args.response.error(parseXMLHttpResponse(data));
10941152
}
10951153
});
10961154
},
@@ -1168,14 +1226,8 @@
11681226
actionFilter: networkOfferingActionfilter
11691227
});
11701228
},
1171-
1172-
notification: {
1173-
poll: function(args) {
1174-
args.complete({
1175-
data: { state: 'Disabled' },
1176-
actionFilter: networkOfferingActionfilter
1177-
});
1178-
}
1229+
error: function(data) {
1230+
args.response.error(parseXMLHttpResponse(data));
11791231
}
11801232
});
11811233
},
@@ -1250,6 +1302,9 @@
12501302
})
12511303
)
12521304
});
1305+
},
1306+
error: function(data) {
1307+
args.response.error(parseXMLHttpResponse(data));
12531308
}
12541309
});
12551310
}
@@ -1299,6 +1354,9 @@
12991354
args.response.success({
13001355
fields: fields
13011356
});
1357+
},
1358+
error: function(data) {
1359+
args.response.error(parseXMLHttpResponse(data));
13021360
}
13031361
});
13041362
}
@@ -1333,6 +1391,9 @@
13331391
success: function(json) {
13341392
var item = json.updatenetworkofferingresponse.networkoffering;
13351393
args.response.success();
1394+
},
1395+
error: function(data) {
1396+
args.response.error(parseXMLHttpResponse(data));
13361397
}
13371398
});
13381399
},
@@ -1363,6 +1424,9 @@
13631424
success: function(json) {
13641425
var item = json.updatenetworkofferingresponse.networkoffering;
13651426
args.response.success();
1427+
},
1428+
error: function(data) {
1429+
args.response.error(parseXMLHttpResponse(data));
13661430
}
13671431
});
13681432
},
@@ -1383,6 +1447,9 @@
13831447
},
13841448
success: function(json) {
13851449
args.response.success();
1450+
},
1451+
error: function(data) {
1452+
args.response.error(parseXMLHttpResponse(data));
13861453
}
13871454
});
13881455
},

‎ui/scripts/ui/widgets/listView.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@
232232
}
233233
);
234234
},
235-
error: function(message){
235+
error: function(message) {
236+
if (args.action.createFrom && args.action.addRow != 'false')
237+
$instanceRow.remove();
238+
236239
if (message)
237240
cloudStack.dialog.notice({ message: message });
238241
}

0 commit comments

Comments
 (0)