[Modify] Throw exception

This commit is contained in:
sta 2017-03-08 16:37:54 +09:00
parent 669f923c96
commit 0e9da7ac58

View File

@ -289,15 +289,11 @@ namespace WebSocketSharp.Server
lock (_sync) { lock (_sync) {
WebSocketServiceHost host; WebSocketServiceHost host;
if (_hosts.TryGetValue (path, out host)) { if (_hosts.TryGetValue (path, out host))
_logger.Error ( throw new ArgumentException ("Already in use.", "path");
"A WebSocket service with the specified path has already existed."
);
return;
}
host = new WebSocketServiceHost<TBehavior> (path, initializer, _logger); host = new WebSocketServiceHost<TBehavior> (path, initializer, _logger);
if (!_clean) if (!_clean)
host.KeepClean = false; host.KeepClean = false;