85
Views
8
Comments
Solved
how to deal with a empty respons from a external api
Question

Hello, 


I have on the showDetail action I try to ask a external api from some data. 

But I noticed that on some occasions the respons back will be e empty respons. 


How can I the best deal with this situation.

RijksMuseumScreens.oml
2025-12-15 12-14-19
Ajay Sharma
Solution

Hi Roelof,


Please check https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Handling_REST_Errors

check "Manipulating received error responses" section you can customize response and throw error based on http codes or you can set 200 it will not throw error.

Hope this helps..

Thanks,

Ajay

2025-12-15 12-14-19
Ajay Sharma

Ajay Sharma wrote:

Hi Roelof,


Please check https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Handling_REST_Errors

check "Manipulating received error responses" section you can customize response and throw error based on http codes or you can set 200 it will not throw error.

Hope this helps..

Thanks,

Ajay

 Hi Roelof,

Please mark this post as solution if you think I am able to guide you in right direction...


Thanks,

Ajay

 

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Roelof,

I would suggest you to do a check using the IF node with condition like

GetCollectionDetails.Response.ArtObject.ObjectNumber = ""

before executing the GetTiles API action, in order to avoid the 500 internal error from the GetTiles API action in case of ObjectNumber = ""  (in case of GetCollectionDetails empty response) as implemented in the attached .oml file

Hope this helps you!


Regards,

Benjith Sam

RijksMuseumScreens.oml
UserImage.jpg
Roelof Wobben

hmm

I still get a 500 warning when I want to see the details of some paintings.


and the logs are not very helpfull : 


500 Internal Server Error
at ssRijksMuseumScreens.CcRijksmuseum.ActionGetCollectionDetails(HeContext heContext, ICcRijksmuseumCallbacks _callbacks, String inParamNUMBER, STGetCollectionDetailsResponseStructure& outParamResponse)
at ssRijksMuseumScreens.Flows.FlowMainFlow.ScrnCollectionList.CommandShowDetail(HeContext heContext)

2021-03-18 21-03-15
Benjith Sam
 
MVP

Roelof Wobben wrote:

hmm

I still get a 500 warning when I want to see the details of some paintings.

Yes, it is because of the empty/blank object number from the current table records, which is used as an input parameter while calling the API action

- Either put an additional IF check before calling the API action

Or 

- Define an exception handling mechanism for such scenario


Regards,

Benjith Sam

RijksMuseumScreens.oml
UserImage.jpg
Roelof Wobben

hmm, that is wierd 

As far as I can see the one that causes the 500 error has a objectnumber.
I will look at your oml.


Yep, I doublechecked and it has the objectNumber SK-A-372


I tried your code but still on that painting a 500 response

2025-12-15 12-14-19
Ajay Sharma
Solution

Hi Roelof,


Please check https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Handling_REST_Errors

check "Manipulating received error responses" section you can customize response and throw error based on http codes or you can set 200 it will not throw error.

Hope this helps..

Thanks,

Ajay

2025-12-15 12-14-19
Ajay Sharma

Ajay Sharma wrote:

Hi Roelof,


Please check https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Handling_REST_Errors

check "Manipulating received error responses" section you can customize response and throw error based on http codes or you can set 200 it will not throw error.

Hope this helps..

Thanks,

Ajay

 Hi Roelof,

Please mark this post as solution if you think I am able to guide you in right direction...


Thanks,

Ajay

 

UserImage.jpg
Roelof Wobben

the problem is somewhat complicted. 

The number is not empty but I get a empty response back from the server.
In the code that I made I try to fill in the number with the recieved object Number which is not there in the response. So it chrashes.

I have to think good how to solve that one.

UserImage.jpg
Roelof Wobben

Thanks,.


I do not have that choice 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.