Created
November 29, 2015 06:44
-
-
Save njames/09ba191244023edf5cba to your computer and use it in GitHub Desktop.
function for handling odata error calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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