I had this come to me from a client who has a custom SDK program that creates a folder then populates it with items. It's been in production for a while and most of the time it just works, but occasionally during busy times it errors out. My client has been very diligent in putting in debugging try-catch's to isolate the error but he' stumped as how to knock this issue out.
This is a code snippet:
Try ParentFolder = DB.GetEntryByPath("\Returns") Try ChildFolder.Create(DocFields.FieldByIndex(6) & "-" & _ DocFields.FieldByIndex(5), ParentFolder, False) Catch ex As Exception ChildFolder = DB.GetEntryByPath("\Returns\" & _ DocFields.FieldByIndex(6) & "-" & DocFields.FieldByIndex(5)) End Try Catch ex As Exception Doc.Dispose() TempString = ex.Message & vbCr & vbLf & _ "Getting move to folder in CreateReturn()" MsgBox(TempString) Exit Sub End Try
So at high load times, it sometimes returns the message:
Argument 'Index' is not a valid value
Getting move to folder in CreateReturn()
They thought it may be a licensing issue but that I said that didn't make any sense to me as they haven't disposed of the connection by this point, and other communications with the LF server have already worked before it gets to this point. I suspect it's a timing issue as it's still trying to create the parent folder above this point and it's failing because it's not actually there yet.
So my question is what is the best way to determine if a sdk request has been completed by the server before moving to the next step?