errorCallback( errorObject ) type

Callback function that is invoked in case of an error.

Syntax

errorCallback( errorObject )

Parameters

Name Type Description
errorObject Object An object containing two properties: 'errorCode' and 'description.' The 'errorCode' property corresponds to one of the sap.AuthProxy constants. The 'description' property is a string with more detailed information of what went wrong.

Example

function errorCallback(errCode) {
   //Set the default error message. Used if an invalid code is passed to the
   //function (just in case) but also to cover the
   //sap.AuthProxy.ERR_UNKNOWN case as well.
   var msg = "Unkown Error";
   switch (errCode) {
      case sap.AuthProxy.ERR_INVALID_PARAMETER_VALUE:
         msg = "Invalid parameter passed to method";
         break;
      case sap.AuthProxy.ERR_MISSING_PARAMETER:
         msg = "A required parameter was missing";
         break;
      case sap.AuthProxy.ERR_HTTP_TIMEOUT:
         msg = "The request timed out";
         break;
   };
   //Write the error to the log
   console.error(msg);
   //Let the user know what happened
   navigator.notification.alert(msg, null, "AuthProxy Error", "OK");
};

Source

authproxy.js, line 815.