Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm trying to create folder and then to store the metadata of create folder:
try
{
FolderMetadata folderMetadata = client.Files.CreateFolderAsync(newFolderPath).Result;
}
catch (Exception e)
{
string m = e.Message;
}
And it crashes without any exception.
This method is working for oneDrive : LiveOperationResult meResult = liveConnectClient.GetAsync("me").Result; //this gets info about the client and is also an awaitable task
So what's the best way to create a folder?
This one?
async Task CreateFolder(string folderName )
{ var response = await dbx.Files.CreateFolderAsync(folderName );
} And then to call: System.Threading.Tasks.Task taskCreateFolder = Task.Run(() => CreateFolder(cloudPath)); Thanks |
Your code looks fine. What do you mean by "it crashes without any exception"? That shouldn't be possible. It looks like you're storing the exception message but not reading it (string m = e.Message).
I recommend adding a breakpoint there to see what the actual API exception is. For example, it's possible newFolderPath is invalid.
Hi Gregory,
Thanks for all your answers.
I'm trying to get the result of a task using the following:
try
{
ListFolderResult allItems = dbxClient.Files.EndListFolder(dbxClient.Files.ListFolderAsync(string.Empty, true));
}
catch(ApiException<ListFolderContinueError> err)
{
string message = err.Message;
}
And not getting any error message.
So you're saying the code execution doesn't enter the catch block, which should mean the method succeeded? In that case, from your code, it looks like allItems should then be defined containing the information. What do you do with allItems after this code runs?
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!