I have a VB.NET application that has been successfully using the .NET API to get a list of available files and download any that are missing in our local data share. It has been running once a day, without any issues, for several weeks.
This morning, it is intermitently failing. I've gotten it to work twice, but on most occasions it thows an exception when it attempts to retrieve the list of all of the files available on Dropbox. The exception message that I get is, "Unexpected character encountered while parsing value: <.Path". Nothing has changed about this code in the last few weeks. So it worked just fine for a while, but has suddenly stopped working today.
The VB.NET code is encased in a class, with the following code:
Friend Class clsDropbox
Private m_Dropbox As DropboxClient
Friend Sub New(token As String)
m_Dropbox = New DropboxClient(token)
End Sub
Friend Function ListGpsFiles() As List(Of clsGpsFileZip)
Dim lstReturn As New List(Of clsGpsFileZip)
Dim strError As String
Dim gfz As clsGpsFileZip
Dim lst As Files.ListFolderResult
Dim fmd As Files.Metadata
Try
lst = m_Dropbox.Files.ListFolderAsync("/Apps/GPSLogger for Android/").Result
Catch ex As Exception
strError = "Falied to retrieve file list from Dropbox. "
If Not ex.InnerException.Message Is Nothing Then
strError = strError + ex.InnerException.Message + "."
Else
strError = strError + ex.Message + "."
End If
Call MsgBox(strError)
Application.Exit()
End Try
For Each fmd In lst.Entries
If fmd.IsFile Then
gfz = New clsGpsFileZip(fmd.Name)
If gfz.IsGpsFile Then
gfz.Path = fmd.PathLower
lstReturn.Add(gfz)
End If
End If
Next
Return lstReturn
End Function
End Class
As I say, everything worked fine until this morning, and the code has not changed in the past few weeks. Any advice?