on 09-13-2016 3:36 PM
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": ""
}
]
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.