[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-19 15:09:05 +09:00
parent d3886a256a
commit 8d372c0371

View File

@ -895,12 +895,6 @@ namespace WebSocketSharp.Server
/// -or- /// -or-
/// </para> /// </para>
/// <para> /// <para>
/// The session could not be found.
/// </para>
/// <para>
/// -or-
/// </para>
/// <para>
/// <paramref name="code"/> is 1010 (mandatory extension). /// <paramref name="code"/> is 1010 (mandatory extension).
/// </para> /// </para>
/// <para> /// <para>
@ -917,6 +911,9 @@ namespace WebSocketSharp.Server
/// <paramref name="reason"/> could not be UTF-8-encoded. /// <paramref name="reason"/> could not be UTF-8-encoded.
/// </para> /// </para>
/// </exception> /// </exception>
/// <exception cref="InvalidOperationException">
/// The session could not be found.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException"> /// <exception cref="ArgumentOutOfRangeException">
/// <para> /// <para>
/// <paramref name="code"/> is less than 1000 or greater than 4999. /// <paramref name="code"/> is less than 1000 or greater than 4999.
@ -933,7 +930,7 @@ namespace WebSocketSharp.Server
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 (code, reason); session.Context.WebSocket.Close (code, reason);