Skip to main content
Solved

IFS Cloud22R2 - REST API Response: Error 500 Details Array


Forum|alt.badge.img+9
  • Sidekick (Partner)
  • 85 replies

Hi All,

Assume we have a REST API which gives a response. In the documentation for Response Samples - Error 500, there is an array for details.
Why does it show as an array?
Normally , it is a single record for a database triggered error. 
 

Error 500

 

Best answer by Trewon

Hi,

In IFS context, when you raise an error (Error_SYS.Record_General) you can only return a single error detail record. However it’s returned as an array through the rest endpoint in order to adhere to OData guidelines . Even though one detail is returned, it should be wrapped in an array to adhere to the OData protocol. 

Thanks,
Trewon Weerasooriya

 

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+6
  • Hero (Employee)
  • 35 replies
  • June 13, 2023

Hi,

By using an array, the API can accommodate multiple details for a single error response, which can be useful in scenarios where there are multiple issues or sub-errors associated with the main error. The array structure provides flexibility for capturing and communicating various error details in a consistent and standardized manner.

However using an array for the "details" field aligns with the guidelines and conventions followed in the OData specification, as mentioned in the OData documentation. Adhering to these standards ensures compatibility and consistency across OData-compliant systems and helps facilitate interoperability between different APIs. 

In summary, the representation of the "details" field as an array in the API documentation is in order to adhere to the OData guidelines for error handling.

Thanks,
Trewon Weerasooriya

 


Forum|alt.badge.img+9
  • Author
  • Sidekick (Partner)
  • 85 replies
  • June 13, 2023

@Trewon ,

Can you provide an API ( IFS REST API) where you have overridden the default behaviour and see multiple error details rather than one?
In IFS, when you raise an error (Error_SYS.Record_General) FW sends 500 error with a single error details record.
I would like to know how to override this behaviour and utilise this multiple error details as shown in the documentation.

Thanks
GaSoGB


Forum|alt.badge.img+6
  • Hero (Employee)
  • 35 replies
  • Answer
  • June 13, 2023

Hi,

In IFS context, when you raise an error (Error_SYS.Record_General) you can only return a single error detail record. However it’s returned as an array through the rest endpoint in order to adhere to OData guidelines . Even though one detail is returned, it should be wrapped in an array to adhere to the OData protocol. 

Thanks,
Trewon Weerasooriya

 


Forum|alt.badge.img+9
  • Author
  • Sidekick (Partner)
  • 85 replies
  • June 13, 2023

Thanks a lot for the clarification @Trewon.
I got it now.

 

Best regards
GaSoGB


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings