eclipse / kuksa.val

kuksa.val
Apache License 2.0
89 stars 52 forks source link

Raise exception if not connected #671

Closed erikbosch closed 9 months ago

erikbosch commented 9 months ago

Fixes #667

With this change, if calling authorize before connect you get:


erik@debian3:~/kuksa.val/kuksa-client$ ./hej.py 
Traceback (most recent call last):
  File "/home/erik/kuksa.val/kuksa-client/./hej.py", line 105, in <module>
    client.authorize(token)
  File "/home/erik/kuksa.val/kuksa-client/kuksa_client/grpc/__init__.py", line 678, in wrapper
    raise Exception("Server not connected! Call connect() before using this command!")
Exception: Server not connected! Call connect() before using this command!
erik@debian3:~/kuksa.val/kuksa-client$ 

PR consist of two types of changes:

erikbosch commented 9 months ago

PR extended to also cover async. Also aligned connection check for all methods

erikbosch commented 9 months ago

Need to do some more testing