handleError() 공개 메소드

If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method.
public handleError ( Kraken\Network\NetworkConnectionInterface $conn, Erro\Error | Exceptio\Exception $ex )
$conn Kraken\Network\NetworkConnectionInterface
$ex Erro\Error | Exceptio\Exception
예제 #1
0
 /**
  * @override
  * @inheritDoc
  */
 public function handleError(NetworkConnectionInterface $conn, $ex)
 {
     if ($conn->httpHeadersReceived) {
         $this->httpServer->handleError($conn, $ex);
     } else {
         $this->close($conn, 500);
     }
 }
예제 #2
0
 /**
  * @override
  * @inheritDoc
  */
 public function handleError(NetworkConnectionInterface $conn, $ex)
 {
     if ($conn->WebSocket->established && $this->connCollection->contains($conn)) {
         $this->wsServer->handleError($this->connCollection[$conn], $ex);
     } else {
         $conn->close();
     }
 }
예제 #3
0
 /**
  * Handler triggered when an error has occured during doing operation on existing connection.
  *
  * @param SocketInterface $socket
  * @param Error|Exception $ex
  */
 public function handleError($socket, $ex)
 {
     try {
         $this->component->handleError($socket->conn, $ex);
     } catch (Error $ex) {
         $this->close($socket);
     } catch (Exception $ex) {
         $this->close($socket);
     }
 }
예제 #4
0
 /**
  * @override
  * @inheritDoc
  */
 public function handleError(NetworkConnectionInterface $conn, $ex)
 {
     return $this->component->handleError($conn, $ex);
 }
예제 #5
0
 /**
  * @override
  * @inheritDoc
  */
 public function handleError(NetworkConnectionInterface $conn, $ex)
 {
     if (!$this->isAddressBlocked($conn->getHost())) {
         $this->component->handleError($conn, $ex);
     }
 }