on 2020 Apr 03 2:29 PM
Hi Experts,
How to handle 502 proxy error. It comes when oData service call happens for validation purpose. Please check my sap ui5 code if this can be handled in some or other way by putting try catch blocks. When 404 error comes then message pop up comes with the error using below code.
var errmessage = JSON.parse(oError.responseText);
errmessage.error.message.value
onclick: function () {
lv_BusyDialog.open();
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
var para1= " ";
var para2= " ";
var para3 = ' ';
var url = "/sap/opu/odata/sap/Test_SRV/";
var allfilters = [new sap.ui.model.Filter({
path: "ZZ_para1",
operator: sap.ui.model.FilterOperator.EQ,
value1: para1}),
new sap.ui.model.Filter({
path: "ZZ_para2",
operator: sap.ui.model.FilterOperator.EQ,
value1: para2
}),
new sap.ui.model.Filter({
path: "ZZ_para3",
operator: sap.ui.model.FilterOperator.GE,
value1: para3
})
];
var oModel = new sap.ui.model.odata.v2.ODataModel(url);
sap.ui.getCore().setModel(oModel);
/ oModel.metadataLoaded().then(function (oSuccess) {
oModel.read("/TestSet", {
filters: allfilters,
success: function (oData, oResponse) {
oRouter.navTo("view2");
lv_BusyDialog.close();
},
error: function (oError) {
lv_BusyDialog.close();
var errmessage = JSON.parse(oError.responseText);
MessageBox.show(
errmessage.error.message.value, {
icon: MessageBox.Icon.ERROR,
title: "Sever Error",
actions: [MessageBox.Action.OK],
onClose: function (oAction) {
if (oAction === MessageBox.Action.OK) {
}
}
}
);
}
});
}, function (oError) {
});
},
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.