private bool _handleWebException(CloudBlob blob, WebException err) { var response = (HttpWebResponse)err.Response; if (response.StatusCode == HttpStatusCode.NotFound) { _azureDirectory.CreateContainer(); blob.UploadText(_lockFile); return(true); } return(false); }
private bool _handleWebException(ICloudBlob blob, StorageException err) { if (err.RequestInformation.HttpStatusCode == 404 || err.RequestInformation.HttpStatusCode == 409) { _azureDirectory.CreateContainer(); using (var stream = new MemoryStream()) using (var writer = new StreamWriter(stream)) { writer.Write(_lockFile); blob.UploadFromStream(stream); } return(true); } return(false); }
private bool _handleWebException(BlobClient blob, RequestFailedException err) { if (err.Status == 404) { _azureDirectory.CreateContainer(); using (var stream = new MemoryStream()) using (var writer = new StreamWriter(stream)) { writer.Write(_lockFile); blob.Upload(stream); } return(true); } return(false); }