[Modify] Throw exception
This commit is contained in:
		@@ -430,12 +430,21 @@ namespace WebSocketSharp
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      set {
 | 
					      set {
 | 
				
			||||||
        lock (_forState) {
 | 
					        string msg = null;
 | 
				
			||||||
          string msg;
 | 
					 | 
				
			||||||
          if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
 | 
					 | 
				
			||||||
            _logger.Error (msg);
 | 
					 | 
				
			||||||
            error ("An error has occurred in setting the enable redirection.", null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!_client) {
 | 
				
			||||||
 | 
					          msg = "The set operation cannot be used by servers.";
 | 
				
			||||||
 | 
					          throw new InvalidOperationException (msg);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!canSet (out msg)) {
 | 
				
			||||||
 | 
					          _logger.Warn (msg);
 | 
				
			||||||
 | 
					          return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        lock (_forState) {
 | 
				
			||||||
 | 
					          if (!canSet (out msg)) {
 | 
				
			||||||
 | 
					            _logger.Warn (msg);
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user