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);
     }
 }