- add incompleteArgumentsException

pull/26/head
Simon G 6 years ago
parent f8c87ee6be
commit 5ba3e8bcaf
  1. 17
      GBase.Server/Exceptions/IncompleteArgumentsException.cs
  2. 10
      GBase.Server/ServerProtocol.cs

@ -0,0 +1,17 @@
// Author: Simon Gockner
// Created: 2020-02-09
// Copyright(c) 2020 SimonG. All Rights Reserved.
using System;
namespace GBase.Server.Exceptions
{
public class IncompleteArgumentsException : Exception
{
public IncompleteArgumentsException(string message)
: base(message)
{
}
}
}

@ -29,5 +29,15 @@ namespace GBase.Server
throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Invalid Protocol");
}
}
public static ServerProtocol GetServerProtocolFromString(string @string)
{
if (@string.Equals("http://") || @string.Equals("http"))
return ServerProtocol.Http;
else if (@string.Equals("https://") || @string.Equals("https"))
return ServerProtocol.Https;
else
throw new ArgumentOutOfRangeException(nameof(@string), @string, "Invalid string.");
}
}
}
Loading…
Cancel
Save