Here is my code. I have a method that deletes an Azure Block Blob. I have a try / finally block to log the failure with details, but otherwise to carry on.
I am returning a bool
to identify if the item was deleted or not.
Visual Studio is telling me that the return
statement at the end of the method is unreachable.
public bool Delete(string referenceId)
{
var client = GetBlobClient();
var container = client.GetContainerReference("qwerty");
var blob = container.GetBlockBlobReference(referenceId);
try
{
blob.Delete();
return true;
}
finally
{
Trace.TraceWarning("Delete Blob failed: {0}", referenceId);
}
return false; // <-- THIS LINE.
}
Why is that? Don't I have to return some value in this method.
Your insight is appreciated.