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

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

I do not think 500 error is allowed.

But below errors are possible.

"400 Bad Request - The request cannot be fulfilled due to bad syntax.

"403 Forbidden - The request was a legal request, but the server is refusing to respond to it.

"404 Not Found - The requested resource could not be found but may be available again in the future.

"405 Method Not Allowed - A request was made of a resource using a request method not supported by that resource;

"406 Not Acceptable - The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.

"409 Conflict - Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.

"410 Gone - Indicates that a resources existed earlier but ist not available anymore

"412 Precondition Failed - The server does not meet one of the preconditions that the requester put on the request.

"415 Unsupported Media Type - The request entity has a media type which the server or resource does not support.

"428 Precondition Required (RFC 6585) - The origin server requires the request to be conditional.

Source: /IWBEP/CX_MGW_BUSI_EXCEPTION - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

More Information

Error Response Control for Backend Data Provider - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SA...

Answers (0)