From a849b1c73eb312a93723a30fbc9a3c911dacfaca Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 16 Jan 2016 15:36:12 +0900 Subject: [PATCH] [Modify] Replace it --- websocket-sharp/WebSocket.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 09bf6158..375d5169 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -957,15 +957,8 @@ namespace WebSocketSharp setClientStream (); var res = sendHandshakeRequest (); var msg = checkIfValidHandshakeResponse (res); - if (msg != null) { - _logger.Error (msg); - - msg = "An error has occurred while connecting."; - error (msg, null); - close (new CloseEventArgs (CloseStatusCode.Abnormal, msg), false, false, false); - - return false; - } + if (msg != null) + throw new WebSocketException (CloseStatusCode.ProtocolError, msg); var cookies = res.Cookies; if (cookies.Count > 0)