CalvinDale
CalvinDale

Reputation: 9721

Possible exception(s) thrown by CloudBlockBlob.UploadFromFile(...)

Which exception(s) can be raised by Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.UploadFromFile(...)?

The C# metadata and online documentation page lists no exceptions for this method. Several examples on StackOverflow and elsewhere catch the base Exception class. Presumably only specific exceptions can be thrown. Quick-Starts and Tutorials on learn.microsoft.com don't include error handling.

Could it be just Microsoft.Azure.Storage.StorageException?

Upvotes: 2

Views: 1036

Answers (1)

Zhaoxing Lu
Zhaoxing Lu

Reputation: 6467

The method can throw lots of exceptions like ArgumentException, NotSupportedException, or etc. However, if your inputs are correct, the most possible exceptions are StorageException for communications against Azure Storage service and IOException for reading the file from local disk.

Upvotes: 2

Related Questions