Issue:
I have been using DropBox for the storage of my new document management application's installation file as well as for updated, individual files that can be downloaded at a later date (after the initial installation).
Upon testing the following async call, DropBoxClient.Files.DownloadAsync, I saw that if a file has not been uploaded to my DropBox folder, where all of these application files are to be stored, this call will throw a "path not found" exception (which makes sense).
However, instead of having this error caught by my code's try-catch construct, the application being tested simply ends.
According to replies from DropBox developers in and around 2017, this was a known issue with their API SDK, and consequently would be fixed. However, my own testing for the past day or so appears to have shown that this issue still exists, even with latest version of the DropBox SDK\API, which I implemented using the NuGet Package Manager.
Solution:
I decided to test another async call to see if this situation is common to all of the DropBox API async calls or was merely an issue with the aforementioned async call.
As a result, I tested the following call prior to DownloadAsync call to see if a "path not found" exception would be caught as hoped.
Using the following call, DropBoxClient.Files.GetMetadataAsync, which merely retrieves the meta-data for the specified file, if the file does not exist in my DropBox folder, it will in fact throw the "path not found" exception and the exception will be caught properly with a try-catch construct...
As a result, if you are experiencing a similar issue with your code, simply use the DropBoxClient.Files.GetMetadataAsync call prior to the actual download call to test for your file's existence, while having the ability to trap for an error exception if one arises.