When we execute the API Endpoint to load the data in DB, we get Generic Error Message " 500 There was an error writing to the data store"
Is there a way to capture the Actual Error message and Return it as a message instead of the above?
Example:
Details: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value
Following is the code :onError: a!httpResponse(statusCode: 500,headers: {a!httpHeader(name: "Content-Type", value: "application/json")},body: a!toJson({error: "There was an error writing to the data store"}))
Discussion posts and replies are publicly visible
Hm ... assuming that you use a!writeRecords, according to the documentation there should be some information available.
https://docs.appian.com/suite/help/24.3/Write_Records_Smart_Service.html#parameters
Using a!writeToDataStoreEntity
AFAIK, There is no easy way to show the detailed error message. Usually, I would include a text to contact the administrator.
You can send back pretty much whatever detail you want in an API http response of course, but I don't know how much detail (if any) we can get from the onError of a!writeToDataStoreEntity...