cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RAP unmanaged if_rap_query_provider~select change http status

luizems
Explorer
0 Kudos
1,095

Hi experts,

I'm working with RAP using custom entity, for this reason the interface if_rap_query_provider is part of development.

I'm using the 'select' method and need to do some validations before the mainly select and return error if that's the case. I've implemented Andre Fisher Solution, which covers exceptions, however not error, is there any other way to handle it or change status code in this exception? because it always returns 500 by framework.

Many thanks 🙂

Accepted Solutions (0)

Answers (1)

Answers (1)

dominikeiraelias
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is currently no possibility to influence the response code. The exception provided by in the interface is the only way to abort the execution, leading to an HTTP 500. The message encapsulated in the error is however coming from the exception text raised by your implementation. 

DungVT37
Explorer
0 Kudos
Hello dominikeiraelias,
DungVT37
Explorer
0 Kudos
Hello dominikeiraelias, I am using RAISE EXCEPTION NEW zcl_cx_rap_gen_custom_entity( textid = VALUE scx_t100key( msgid = 'Z_FA_MSG' msgno = 005 attr1 = lv_sql_filter ) previous = exception ). But it will dump in Front-end. Can I only display message error in UI? Thank you
dominikeiraelias
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi @DungVT37, Im not sure what you mean with dump in frontend, but as mentioned raising the exception will leead to an HTTP 500 Internal Server error. No messages are being display on the UI in this case. The query implementation acts like a DB query. The DB will either return the data or an error code, no additional messages.