Skip to content

Commit

Permalink
add api key check
Browse files Browse the repository at this point in the history
  • Loading branch information
mohyour committed Sep 14, 2022
1 parent 4d5f00f commit 7e73898
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ably/realtime/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ably/realtime/realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,5 +44,5 @@ def options(self):

@property
def connection(self):
"""Returns the channels container object"""
"""Establish realtime connection"""
return self.__connection

0 comments on commit 7e73898

Please sign in to comment.