[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-19 14:54:15 +09:00
parent 669e1ca821
commit d3886a256a

View File

@ -842,22 +842,17 @@ namespace WebSocketSharp.Server
/// <paramref name="id"/> is <see langword="null"/>. /// <paramref name="id"/> is <see langword="null"/>.
/// </exception> /// </exception>
/// <exception cref="ArgumentException"> /// <exception cref="ArgumentException">
/// <para> /// <paramref name="id"/> is an empty string.
/// <paramref name="id"/> is an empty string. /// </exception>
/// </para> /// <exception cref="InvalidOperationException">
/// <para> /// The session could not be found.
/// -or-
/// </para>
/// <para>
/// The session could not be found.
/// </para>
/// </exception> /// </exception>
public void CloseSession (string id) public void CloseSession (string id)
{ {
IWebSocketSession session; IWebSocketSession session;
if (!TryGetSession (id, out session)) { if (!TryGetSession (id, out session)) {
var msg = "The session could not be found."; var msg = "The session could not be found.";
throw new ArgumentException (msg, "id"); throw new InvalidOperationException (msg);
} }
session.Context.WebSocket.Close (); session.Context.WebSocket.Close ();