public function onError(ConnectionInterface $conn, \Exception $e) {

        try {
            throw new \Exception($e->getMessage());
        }
        catch(\Exception $e) {
            throw new SocketServiceException(Messenger::error($e->getMessage()));
        }
        finally {
            $conn->close();
        }
    }
public function onError(ConnectionInterface $conn, \Exception $e) {

        try {
            throw new \Exception($e->getMessage());
        }
        catch(\Exception $e) {
            throw new SocketServiceException(Messenger::error($e->getMessage()));
        }
        finally {
            $conn->close();
        }
    }
public function onError ( ConnectionInterface $ conn , \ Exception $ e ) { try { throw new \ Exception ( $ e -> getMessage ( ) ) ; } catch ( \ Exception $ e ) { throw new SocketServiceException ( Messenger :: error ( $ e -> getMessage ( ) ) ) ; } finally { $ conn -> close ( ) ; } }
Error event emitter

@param ConnectionInterface $conn
@param \Exception          $e
@throws \Sonar\Exceptions\AppServiceException
Error event emitter