Skip to content

Instantly share code, notes, and snippets.

@njames
Created November 29, 2015 06:44
Embed
What would you like to do?
function for handling odata error calls
function(oError) {
this.setBusy(false);
// var msg = $(oError.response.body).find('message').first().text();
try {
var msg = JSON.parse( oError.response.body).error.message.value;
msg = msg.split("|")[1];
} finally {
msg = "An error occurred on requesting access.";
}
jQuery.sap.require("sap.m.MessageBox");
sap.m.MessageBox.show(msg,
sap.m.MessageBox.Icon.ERROR,
"Error", [sap.m.MessageBox.Action.CLOSE]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment