/** * Called whenever a client errors * * @param ClientErrorEvent $event */ public function onClientError(ClientErrorEvent $event) { $conn = $event->getConnection(); $e = $event->getException(); $this->logoutUser($conn); echo "connection error occurred: " . $e->getMessage() . PHP_EOL; }
public function onError(Conn $conn, \Exception $e) { $event = new ClientErrorEvent($conn, ClientEvent::$error); $event->setException($e); $this->eventDispatcher->dispatch("clank.client.error", $event); }