Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@njames
Created November 29, 2015 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njames/09ba191244023edf5cba to your computer and use it in GitHub Desktop.
Save njames/09ba191244023edf5cba to your computer and use it in GitHub Desktop.
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