From 09d3724b31229c89e1025e82f301ff5eacfad7b2 Mon Sep 17 00:00:00 2001 From: Bianco Veigel Date: Fri, 19 May 2017 18:55:20 +0200 Subject: [PATCH] add missing summary comments --- Graphite/Exceptions/HttpRequestException.cs | 33 +++++++++++++++++++ .../HttpResponseMessageExtension.cs | 6 ++++ 2 files changed, 39 insertions(+) diff --git a/Graphite/Exceptions/HttpRequestException.cs b/Graphite/Exceptions/HttpRequestException.cs index 6212ddd..a32b6a0 100644 --- a/Graphite/Exceptions/HttpRequestException.cs +++ b/Graphite/Exceptions/HttpRequestException.cs @@ -1,32 +1,61 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Net; using System.Runtime.Serialization; namespace ahd.Graphite.Exceptions { + /// + /// A base class for exceptions thrown by the and classes. + /// [Serializable] public class HttpRequestException: System.Net.Http.HttpRequestException { + /// + /// Initializes a new instance of the HttpRequestException class. + /// + /// Statuscode of the response + /// response content public HttpRequestException(HttpStatusCode statuscode, string response):base() { StatusCode = statuscode; Response = response; } + /// + /// Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception + /// + /// response content + /// exception message public HttpRequestException(string response, string message):base(message) { Response = response; } + /// + /// Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception and an inner exception. + /// + /// response content + /// exception message + /// inner exception public HttpRequestException(string response, string message, Exception inner):base(message, inner) { Response = response; } + /// + /// statuscode of the HTTP response + /// public HttpStatusCode StatusCode { get; private set; } + /// + /// Content of the HTTP response + /// public string Response { get; private set; } + /// + /// Security Critical. (Inherited from Exception.) + /// public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) @@ -40,6 +69,10 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont base.GetObjectData(info, context); } + /// + /// Initializes a new instance of the HttpRequestException class. + /// + [SuppressMessage("Microsoft.Usage", "CA2236:CallBaseClassMethodsOnISerializableTypes", Justification = "base ctor is missing - blame Microsoft")] protected HttpRequestException(SerializationInfo info, StreamingContext context) { Response = info.GetString(nameof(Response)); diff --git a/Graphite/Exceptions/HttpResponseMessageExtension.cs b/Graphite/Exceptions/HttpResponseMessageExtension.cs index 867fae9..97713df 100644 --- a/Graphite/Exceptions/HttpResponseMessageExtension.cs +++ b/Graphite/Exceptions/HttpResponseMessageExtension.cs @@ -3,8 +3,14 @@ namespace ahd.Graphite.Exceptions { + /// + /// Extensions for + /// public static class HttpResponseMessageExtension { + /// + /// checks the statuscode and throws a with the full response content + /// public static async Task EnsureSuccessStatusCodeAsync(this HttpResponseMessage response) { if (response.IsSuccessStatusCode)