cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Gateway Exception

0 Kudos

Hi everybody.

I'm starting with sap gateway and i'd like to custom my error response when i'm calling the exception.

It would be possible? For example:

The original response:

{

  "error": {

    "code": "SY/530",

    "message": {

      "lang": "pt",

      "value": "MESSAGE I"

    },

    "innererror": {

      "application": {

        "component_id": "BC",

        "service_namespace": "/SAP/",

        "service_id": "ZGW_PLANNING_PRODUCTION_SRV_01",

        "service_version": "0001"

      },

      "transactionid": "57CE749CDC2E533AE1000000AC0C0CD0",

      "timestamp": "",

      "Error_Resolution": {

        "SAP_Transaction": "",

        "SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"

      },

      "errordetails": [

        {

          "code": "",

          "message": "MESSAGE I.",

          "propertyref": "",

          "severity": "error",

          "target": ""

        },

        {

          "code": "",

          "message": "MESSAGE II.",

          "propertyref": "",

          "severity": "error",

          "target": ""

        },

        {

          "code": "/IWBEP/CX_MGW_BUSI_EXCEPTION",

          "message": "",

          "propertyref": "",

          "severity": "error",

          "target": ""

        }

      ]

    }

  }

}

I'd like to receive the following structure:


{

      "errordetails": [

        {

          "code": "",

          "message": "MESSAGE I",

          "propertyref": "",

          "severity": "error",

          "target": ""

        },

        {

          "code": "XX",

          "message": "MESSAGE II",

          "propertyref": "",

          "severity": "error",

          "target": ""

        }

      ]

}


Accepted Solutions (0)

Answers (1)

Answers (1)

Ryan-Crosby
Active Contributor
0 Kudos

Hi Enio,

Is there some reason you would want to reduce the amount of information that is returned?  The error payload is in a straightforward JSON string format that can easily be converted into a JavaScript object with one line of code.  Likely any attempt to intercept the message output for an exception and override the value would require a number of standard code changes.

Regards,

Ryan Crosby