cancel
Showing results for 
Search instead for 
Did you mean: 

How to send status code 500 from Gateway

manuelbordallo
Explorer
0 Kudos

Hi colleges,

I'm starting with SAPUI5.

We have build an app that connects to SAP Gateway and we are looking the way to send back error messages from the business logic.

I found the way to achieve it raising exceptions (/IWBEP/CX_MGW_BUSI_EXCEPTION) but when the error arrives in UI5 it always have status code 400.

Is there any way to send other status code depending on the specific error?

If you have more information to share concerning the error message handling between GW and client, I'll be very pleased.

Thank you & best regards,

Manuel

View Entire Topic
former_member182372
Active Contributor
0 Kudos

try /IWBEP/CX_MGW_TECH_EXCEPTION

https://sites.google.com/site/sapcrmcheatsheet/nw-gateway/gw-exceptions

Gateway provides ways to communicate to the calling API exceptions in business processing or system processing of data. Gateway supports two types of exceptions 1) Technical 2) Business.  How they are implemented and in what context is entirely up to the developer. From an API standpoint they only differ in the status codes returned . Business exceptions return HTTP 4XX and Technical exceptions return HTTP 500.