/**
  * Called whenever a client errors.
  *
  * @param ClientErrorEvent $event
  */
 public function onClientError(ClientErrorEvent $event)
 {
     $conn = $event->getConnection();
     $e = $event->getException();
     $loggerContext = array('connection_id' => $conn->resourceId, 'session_id' => $conn->WAMP->sessionId);
     if ($this->clientStorage->hasClient($conn->resourceId)) {
         $loggerContext['client'] = $this->clientStorage->getClient($conn->WAMP->clientStorageId);
     }
     $this->logger->error(sprintf('Connection error occurred %s in %s line %s', $e->getMessage(), $e->getFile(), $e->getLine()), $loggerContext);
 }
 /**
  * @param ConnectionInterface $conn
  * @param \Exception          $e
  */
 public function onError(ConnectionInterface $conn, \Exception $e)
 {
     $event = new ClientErrorEvent($conn, ClientEvent::ERROR);
     $event->setException($e);
     $this->eventDispatcher->dispatch(Events::CLIENT_ERROR, $event);
 }