[Modify] Throw InvalidOperationException

This commit is contained in:
sta 2017-08-19 15:17:03 +09:00
parent 8d372c0371
commit 3d303fbe4a

View File

@ -970,12 +970,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 /// <paramref name="code"/> is
/// <see cref="CloseStatusCode.MandatoryExtension"/>. /// <see cref="CloseStatusCode.MandatoryExtension"/>.
/// </para> /// </para>
@ -994,6 +988,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">
/// The size of <paramref name="reason"/> is greater than 123 bytes. /// The size of <paramref name="reason"/> is greater than 123 bytes.
/// </exception> /// </exception>
@ -1002,7 +999,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);