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 |
/** * @override * @inheritDoc */ public function handleError(NetworkConnectionInterface $conn, $ex) { if ($conn->httpHeadersReceived) { $this->httpServer->handleError($conn, $ex); } else { $this->close($conn, 500); } }
/** * @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(); } }
/** * 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); } }
/** * @override * @inheritDoc */ public function handleError(NetworkConnectionInterface $conn, $ex) { return $this->component->handleError($conn, $ex); }
/** * @override * @inheritDoc */ public function handleError(NetworkConnectionInterface $conn, $ex) { if (!$this->isAddressBlocked($conn->getHost())) { $this->component->handleError($conn, $ex); } }