aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/HttpResponseParser.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-06 21:50:43 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-10 20:38:53 +0100
commitec1f5dc317182582ebff843c9e8a4d5277405469 (patch)
tree6514de336cc9aa94becb3fbd767285dfa61d0b1b /RSSDP/HttpResponseParser.cs
parent3d867c2c46cec39b669bb8647efef677f32b8a8d (diff)
Mayor code cleanup
Add Argument*Exceptions now use proper nameof operators. Added exception messages to quite a few Argument*Exceptions. Fixed rethorwing to be proper syntax. Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling) Added some TODOs to log certain exceptions. Fix sln again. Fixed all AssemblyInfo's and added proper copyright (where I could find them) We live in *current year*. Fixed the use of braces. Fixed a ton of properties, and made a fair amount of functions static that should be and can be static. Made more Methods that should be static static. You can now use static to find bad functions! Removed unused variable. And added one more proper XML comment.
Diffstat (limited to 'RSSDP/HttpResponseParser.cs')
-rw-r--r--RSSDP/HttpResponseParser.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs
index 8ecb944c2..eb170ea24 100644
--- a/RSSDP/HttpResponseParser.cs
+++ b/RSSDP/HttpResponseParser.cs
@@ -71,17 +71,17 @@ namespace Rssdp.Infrastructure
/// <param name="message">Either a <see cref="System.Net.Http.HttpResponseMessage"/> or <see cref="System.Net.Http.HttpRequestMessage"/> to assign the parsed values to.</param>
protected override void ParseStatusLine(string data, HttpResponseMessage message)
{
- if (data == null) throw new ArgumentNullException("data");
- if (message == null) throw new ArgumentNullException("message");
+ if (data == null) throw new ArgumentNullException(nameof(data));
+ if (message == null) throw new ArgumentNullException(nameof(message));
var parts = data.Split(' ');
- if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data");
+ if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", nameof(data));
message.Version = ParseHttpVersion(parts[0].Trim());
int statusCode = -1;
if (!Int32.TryParse(parts[1].Trim(), out statusCode))
- throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", "data");
+ throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", nameof(data));
message.StatusCode = (HttpStatusCode)statusCode;