Skip to content

Commit

Permalink
Merge pull request #10 from stankovski/master
Browse files Browse the repository at this point in the history
Added non-generic HttpOperationException
  • Loading branch information
jianghaolu committed Feb 27, 2015
2 parents d495530 + 5f7cb7a commit 101afef
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions Microsoft.Rest/ClientRuntime/HttpOperationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,52 @@ namespace Microsoft.Rest
"Microsoft.Usage",
"CA2237:MarkISerializableTypesWithSerializable",
Justification = "All properties of this class get serialized manually")]
public class HttpOperationException<T> : HttpRequestException
public class HttpOperationException<T> : HttpOperationException
{
/// <summary>
/// Gets or sets the response object.
/// </summary>
public T Body { get; set; }

/// <summary>
/// Initializes a new instance of the HttpOperationException class.
/// </summary>
public HttpOperationException()
: base()
{
}

/// <summary>
/// Initializes a new instance of the HttpOperationException class.
/// </summary>
/// <param name="message">The exception message.</param>
public HttpOperationException(string message)
: this(message, null)
{
}

/// <summary>
/// Initializes a new instance of the HttpOperationException class.
/// </summary>
/// <param name="message">The exception message.</param>
/// <param name="innerException">Inner exception.</param>
public HttpOperationException(string message, Exception innerException)
: base(message, innerException)
{
}
}

/// <summary>
/// Exception thrown for an invalid response with custom error information.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1032:ImplementStandardExceptionConstructors"),
System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Usage",
"CA2237:MarkISerializableTypesWithSerializable",
Justification = "All properties of this class get serialized manually")]
public class HttpOperationException : HttpRequestException
{
/// <summary>
/// Gets information about the associated HTTP request.
Expand All @@ -28,15 +73,10 @@ public class HttpOperationException<T> : HttpRequestException
/// </summary>
public HttpResponseMessage Response { get; set; }

/// <summary>
/// Gets or sets the response object.
/// </summary>
public T Body { get; set; }

/// <summary>
/// Initializes a new instance of the HttpOperationException class.
/// </summary>
public HttpOperationException()
public HttpOperationException()
: base()
{
}
Expand All @@ -58,6 +98,6 @@ public HttpOperationException(string message)
public HttpOperationException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}
}

0 comments on commit 101afef

Please sign in to comment.