I am developing a web app in Outsystems 11 where I pull in data from an external API and display the results to the interface.


I have recently found an issue where the API will return a 500 error from it's end (tested this in postman to confirm.) And don't have a real solution to fix it.


Instead, I was looking for a solution to simply bypass it and keep the app going instead of throwing an error part way through and stopping the script.


The image attached is of the affected API call and I added in the IF statement to simulate how I want it to behave, but I am not able to pull the status from the API itself, and nothing in the response of the API is unique to set it apart from other similar non-error-throwing calls. 


Is there a way in Outsystems to read in the status of an error and bypass it?

Hello Cody,

Can you please send an example of the Request and Response of an API call?

Why you need to create that "bypass"? If the response return the error "500" you got an error and OS throwns on an excpetion?


BR,

Luis

Luís Cardoso wrote:

Hello Cody,

Can you please send an example of the Request and Response of an API call?

Why you need to create that "bypass"? If the response return the error "500" you got an error and OS throwns on an excpetion?


BR,

Luis

Here is an example request:

https://{domain}/learn/api/public/v1/courses/{cid}/contents/{contentId}/children

Here is an example response:

```

"id"\: "_xxxxxxx_1",  

"parentId"\: "_xxxxxxx_1",   

"title"\: "Test",  

"body"\: "<p></p>",  

"created"\: "2019-11-25T18\:39\:25.000Z", 

"position"\: 0,            

"hasChildren"\: true,           

 "availability"\: {               

             "available"\: "Yes",                

             "allowGuests"\: true,                

             "adaptiveRelease"\: {}            

},            

"contentHandler"\: {                

             "id"\: "resource/x-bb-folder"            

}

```


I need to bypass as the error is thrown and all operations stop. I simply want it to see the 500 error, and keep moving, as if the record did not exist.

Cody Zehner wrote:

Luís Cardoso wrote:

Hello Cody,

Can you please send an example of the Request and Response of an API call?

Why you need to create that "bypass"? If the response return the error "500" you got an error and OS throwns on an excpetion?


BR,

Luis

Here is an example request:

https://{domain}/learn/api/public/v1/courses/{cid}/contents/{contentId}/children

Here is an example response:

```

"id"\: "_xxxxxxx_1",  

"parentId"\: "_xxxxxxx_1",   

"title"\: "Test",  

"body"\: "<p></p>",  

"created"\: "2019-11-25T18\:39\:25.000Z", 

"position"\: 0,            

"hasChildren"\: true,           

 "availability"\: {               

             "available"\: "Yes",                

             "allowGuests"\: true,                

             "adaptiveRelease"\: {}            

},            

"contentHandler"\: {                

             "id"\: "resource/x-bb-folder"            

}

```


I need to bypass as the error is thrown and all operations stop. I simply want it to see the 500 error, and keep moving, as if the record did not exist.

Hello,

As I understand you wanto to "skip"/"bypass" if the return is error 500, right?
But you did not receive that on the response... can you show the response on postman?

Also, that API was made in OutSystems?

I think you can try to understand and solve what is the problem to got that error.

Please look at this doc link: https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Expose_REST_APIs/Throw_a_Custom_Error_in_an_Exposed_REST_API

And this posts of forum related with the same issue:

https://www.outsystems.com/forums/discussion/19555/api-call-500-internal-server-error/

https://www.outsystems.com/forums/discussion/37118/500-internal-server-error-when-rest-api-call/


Hope it helps.

BR,

Luis