Skip to content

Commit

Permalink
[Storage] Fix exception ctor param name. (#21716)
Browse files Browse the repository at this point in the history
...
  • Loading branch information
kasobol-msft committed Jun 8, 2021
1 parent 79a15d3 commit 857b59f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ public partial class ShareFileLease
public string LeaseId { get { throw null; } }
public int? LeaseTime { get { throw null; } }
}
public partial class ShareFileModificationException : System.Exception, System.Runtime.Serialization.ISerializable
public partial class ShareFileModifiedException : System.Exception, System.Runtime.Serialization.ISerializable
{
protected ShareFileModificationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext streamingContext) { }
public ShareFileModificationException(string message, System.Uri resurceUri, Azure.ETag expectedETag, Azure.ETag actualEtag, Azure.HttpRange range) { }
protected ShareFileModifiedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext streamingContext) { }
public ShareFileModifiedException(string message, System.Uri resourceUri, Azure.ETag expectedETag, Azure.ETag actualETag, Azure.HttpRange range) { }
public Azure.ETag ActualETag { get { throw null; } }
public Azure.ETag ExpectedETag { get { throw null; } }
public Azure.HttpRange Range { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Azure.Storage.Files.Shares.Models
/// observed that a file content has been modified during the read.
/// </summary>
[Serializable]
public class ShareFileModificationException : Exception, ISerializable
public class ShareFileModifiedException : Exception, ISerializable
{
/// <summary>
/// Gets the URI of the resurce that has been modified.
Expand All @@ -36,28 +36,28 @@ public class ShareFileModificationException : Exception, ISerializable
public HttpRange Range { get; }

/// <summary>
/// Creates a new instance of <see cref="ShareFileModificationException"/>.
/// Creates a new instance of <see cref="ShareFileModifiedException"/>.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="resurceUri">The URI of the resurce that has been modified.</param>
/// <param name="resourceUri">The URI of the resource that has been modified.</param>
/// <param name="expectedETag">The ETag value that was expected during the read.</param>
/// <param name="actualEtag">The ETag value that was received from the service.</param>
/// <param name="actualETag">The ETag value that was received from the service.</param>
/// <param name="range">The range that was requested for the service.</param>
public ShareFileModificationException(
public ShareFileModifiedException(
string message,
Uri resurceUri,
Uri resourceUri,
ETag expectedETag,
ETag actualEtag,
ETag actualETag,
HttpRange range) : base(message)
{
ResourceUri = resurceUri;
ResourceUri = resourceUri;
ExpectedETag = expectedETag;
ActualETag = actualEtag;
ActualETag = actualETag;
Range = range;
}

/// <inheritdoc />
protected ShareFileModificationException(SerializationInfo info, StreamingContext streamingContext)
protected ShareFileModifiedException(SerializationInfo info, StreamingContext streamingContext)
{
ResourceUri = (Uri)info.GetValue(nameof(ResourceUri), typeof(Uri));
ExpectedETag = (ETag)info.GetValue(nameof(ExpectedETag), typeof(ETag));
Expand Down
20 changes: 10 additions & 10 deletions sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ private void SetNameFieldsIfNull()
.EnsureCompleted();
if (etag != Response.GetRawResponse().Headers.ETag)
{
throw new ShareFileModificationException(
throw new ShareFileModifiedException(
"File has been modified concurrently",
Uri, etag, Response.GetRawResponse().Headers.ETag.GetValueOrDefault(), range);
}
Expand All @@ -1893,7 +1893,7 @@ private void SetNameFieldsIfNull()
.ConfigureAwait(false);
if (etag != Response.GetRawResponse().Headers.ETag)
{
throw new ShareFileModificationException(
throw new ShareFileModifiedException(
"File has been modified concurrently",
Uri, etag, Response.GetRawResponse().Headers.ETag.GetValueOrDefault(), range);
}
Expand Down Expand Up @@ -2014,7 +2014,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified and <see cref="ShareFileOpenReadOptions"/> don't allow modification.
/// </remarks>
#pragma warning disable AZC0015 // Unexpected client method return type.
Expand Down Expand Up @@ -2046,7 +2046,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified and <see cref="ShareFileOpenReadOptions"/> don't allow modification.
/// </remarks>
#pragma warning disable AZC0015 // Unexpected client method return type.
Expand Down Expand Up @@ -2087,7 +2087,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -2130,7 +2130,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -2172,7 +2172,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -2215,7 +2215,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -2263,7 +2263,7 @@ private void SetNameFieldsIfNull()
/// is read from.
/// </returns>
/// <remarks>
/// The stream returned might throw <see cref="ShareFileModificationException"/>
/// The stream returned might throw <see cref="ShareFileModifiedException"/>
/// if the file is concurrently modified and allowModifications is false.
/// </remarks>
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
Expand Down Expand Up @@ -2303,7 +2303,7 @@ private void SetNameFieldsIfNull()
if (!allowModifications && etag != response.GetRawResponse().Headers.ETag)
{
throw new ShareFileModificationException(
throw new ShareFileModifiedException(
"File has been modified concurrently",
Uri, etag, response.GetRawResponse().Headers.ETag.GetValueOrDefault(), range);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ public async Task DownloadAsync_WithUnreliableConnection_ConcurrentModification(

// Read data stream
var actual = new MemoryStream();
await TestHelper.AssertExpectedExceptionAsync<ShareFileModificationException>(
await TestHelper.AssertExpectedExceptionAsync<ShareFileModifiedException>(
downloadInfo.Content.CopyToAsync(actual, 4 * Constants.KB),
e => {
Assert.AreEqual(e.ResourceUri, file.Uri);
Expand Down Expand Up @@ -3224,7 +3224,7 @@ public async Task OpenReadAsync_ConcurrentModification_NotAllowed()
await file.UploadAsync(stream2);
byte[] outputBytes = new byte[size];

await TestHelper.AssertExpectedExceptionAsync<ShareFileModificationException>(
await TestHelper.AssertExpectedExceptionAsync<ShareFileModifiedException>(
outputStream.ReadAsync(outputBytes, 0, size),
e => {
Assert.AreEqual(e.ResourceUri, file.Uri);
Expand Down

0 comments on commit 857b59f

Please sign in to comment.