diff --git a/ably/realtime/connection.py b/ably/realtime/connection.py index bd3b21df..a9e24341 100644 --- a/ably/realtime/connection.py +++ b/ably/realtime/connection.py @@ -69,7 +69,8 @@ async def ws_read_loop(self): error = msg["error"] if error['nonfatal'] is False: if self.connected_future: - self.connected_future.set_exception(AblyAuthException(error["message"], error["statusCode"], error["code"])) + self.connected_future.set_exception( + AblyAuthException(error["message"], error["statusCode"], error["code"])) self.connected_future = None @property diff --git a/ably/realtime/realtime.py b/ably/realtime/realtime.py index 25f57a2a..36cf1cbe 100644 --- a/ably/realtime/realtime.py +++ b/ably/realtime/realtime.py @@ -21,7 +21,7 @@ def __init__(self, key=None, **kwargs): if key is not None: options = Options(key=key, **kwargs) else: - options = Options(**kwargs) + raise ValueError("Key is missing. Provide an API key") self.__auth = Auth(self, options) self.__options = options @@ -44,5 +44,5 @@ def options(self): @property def connection(self): - """Returns the channels container object""" + """Establish realtime connection""" return self.__connection