Feedback: What does the `bool` return value indicate on `CloudStorageAccount.CreateIfNotExistsAsync()` (and friends)?

Created on 12 Mar 2018  路  10Comments  路  Source: MicrosoftDocs/feedback

On this page (and a bunch of others documenting the same set of classes), the Returns declaration just says

A Task<T> of type bool that represents the asynchronous operation.

It would be much more helpful if the documentation would also specify in what cases the methods return true or false. For example, in which of the following cases would the method above return true, and for which ones false?

  • Everything went OK, the table didn't exist before and was created now
  • Everything went OK, the table existed before, so nothing more was done now
  • Listing tables went OK, the table didn't exist before but something went wrong when trying to create it
  • Something went wrong when listing tables

Looking at the bool that's returned by these methods, is there any way I can know whether the table exists? Is there any way I can know that I need to try again? The current docs don't help me figure that out.

Pri3 content resolved

Most helpful comment

@tlycken - Thanks for your feedback, you raise a good point. We need to document what the return value for the method means in terms of behavior.

For your own purposes, the asynchronous method always returns the same type as the synchronous method, but as a generic type of a Task object. See https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 for more information about the Task object.

So the behavior for CloudTable.CreateIfNotExistsAsync is the same as for CloudTable.CreateIfNotExists. That behavior is that the method returns True if the table was created, and False if it was not (that is, if it already exists). If an error occurs, it throws an exception.

@mirobers FYI.

All 10 comments

@mairaw I believe this is a content issue. Can you help me move it to the correct repo?

@dend indeed looks like a content issue but this is Azure SDK. Not sure who owns it right now. @erickson-doug is listed as the owner.

@mmacy @twitchax for visibility on the issue.

@tamram for visibility

FWIW, I got here from the "feedback" link by the documentation page. If it points to the wrong place, might be worthwhile looking into fixing that too :)

That's the right spot @tlycken. However, when we identify that the issue being reported is a content issue and not a general site feedback, we try to move the issue to the associated content repo.

@tlycken - Thanks for your feedback, you raise a good point. We need to document what the return value for the method means in terms of behavior.

For your own purposes, the asynchronous method always returns the same type as the synchronous method, but as a generic type of a Task object. See https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 for more information about the Task object.

So the behavior for CloudTable.CreateIfNotExistsAsync is the same as for CloudTable.CreateIfNotExists. That behavior is that the method returns True if the table was created, and False if it was not (that is, if it already exists). If an error occurs, it throws an exception.

@mirobers FYI.

@tamram Thanks for clarifying! :)

please-close

#please-address

..in the documentation.. still don't see a resolution to this in the assembly's comments nor in the man page

Was this page helpful?
0 / 5 - 0 ratings