Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

throw exception during uploading and downloading

  • Loading branch information...
commit e7b5977e000157cf131f2541170ab0e51f761f77 1 parent 2fb488a
@xmbms xmbms authored
View
13 WindowsAzurePowershell/src/Management.Storage/Blob/Cmdlet/GetAzureStorageBlobContent.cs
@@ -174,6 +174,11 @@ internal virtual void OnProgress(object progress, double speed, double percent)
private bool finished = false;
/// <summary>
+ /// exception thrown during downloading
+ /// </summary>
+ private Exception downloadException = null;
+
+ /// <summary>
/// on downloading finish
/// </summary>
/// <param name="progress">progress information</param>
@@ -191,7 +196,8 @@ internal virtual void OnFinish(object progress, Exception e)
}
pr.PercentComplete = 100;
-
+ downloadException = e;
+
if (null == e)
{
pr.StatusDescription = String.Format(Resources.DownloadBlobSuccessful, BlobName);
@@ -237,6 +243,11 @@ internal virtual void DownloadBlob(ICloudBlob blob, string filePath)
}
transferManager.WaitForCompletion();
+
+ if (downloadException != null)
+ {
+ throw downloadException;
+ }
}
}
View
11 WindowsAzurePowershell/src/Management.Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs
@@ -199,6 +199,11 @@ internal virtual void OnProgress(object progress, double speed, double percent)
private bool finished = false;
/// <summary>
+ /// exception thrown during uploading
+ /// </summary>
+ private Exception uploadException = null;
+
+ /// <summary>
/// on uploading finish
/// </summary>
/// <param name="progress">progress information</param>
@@ -216,6 +221,7 @@ internal virtual void OnFinish(object progress, Exception e)
}
pr.PercentComplete = 100;
+ uploadException = e;
if (null == e)
{
@@ -264,6 +270,11 @@ internal virtual void Upload2Blob(string filePath, ICloudBlob blob)
}
transferManager.WaitForCompletion();
+
+ if (uploadException != null)
+ {
+ throw uploadException;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.