While trying to create a DocumentSet with a name that already exists in DocumentLibrary using /_vti_bin/listdata.svc (SPO) a 500 internal server exception is thrown. I understand the reason for the exception, but 500 internal error can be thrown for various reasons, and i couldn't from the error response infer the cause of the error. The API call is made from .net application (HttpClient), the response content is as below:
{
"error": {
"code": "", "message": {
"lang": "en-US", "value": "An error occurred while processing this request."
}
}
}
I have two questions:
- How to get detailed error information from call to listdata.svc, so that appropriate logic can be executed if error is due to DocumentSet already existing?
- Is it possible to structure the call so that a DocumentSet is created if it does not exists?
Note: Checking if a DocmentSet exist prior to making call to listdata.svc is not an option due to multiple calls/race conditions.