zepben.ewb 1.0.0b6__py3-none-any.whl → 1.0.0b7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,7 @@ class GrpcChannelBuilder(ABC):
86
86
 
87
87
  def _test_connection(self, channel: grpc.Channel, debug: bool, timeout_seconds: int):
88
88
  debug_errors = []
89
+ permission_errors = []
89
90
  for name, client in zip(self._stubs.keys(), map(lambda stub: stub(channel), list(self._stubs.values()))):
90
91
  try:
91
92
  result = client.checkConnection(CheckConnectionRequest(), timeout=timeout_seconds, wait_for_ready=False)
@@ -93,7 +94,11 @@ class GrpcChannelBuilder(ABC):
93
94
  return
94
95
  except _InactiveRpcError as rpc_error:
95
96
  debug_errors.append(f"Received the following exception with {name}:\n{rpc_error}\n")
96
- raise GrpcConnectionException(f"Couldn't establish gRPC connection to any service on {self._socket_address}.\n{''.join(debug_errors) if debug else ''}")
97
+ if rpc_error.code() in (grpc.StatusCode.UNAUTHENTICATED, grpc.StatusCode.PERMISSION_DENIED):
98
+ permission_errors.append(f"Received the following exception with {name}:\n\t{rpc_error.code().name}: {rpc_error.details()}\n")
99
+ # Preference propagating permissions errors to users if any exist, otherwise just take the first error from the first service we tried.
100
+ propagate = ''.join(permission_errors) if permission_errors else debug_errors[0]
101
+ raise GrpcConnectionException(f"Couldn't establish gRPC connection to any service on {self._socket_address}.\n{''.join(debug_errors) if debug else propagate}")
97
102
 
98
103
  def for_address(self, host: str, port: int) -> 'GrpcChannelBuilder':
99
104
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zepben.ewb
3
- Version: 1.0.0b6
3
+ Version: 1.0.0b7
4
4
  Summary: Python SDK for interacting with the Energy Workbench platform
5
5
  Author-email: Kurt Greaves <kurt.greaves@zepben.com>, Max Chesterfield <max.chesterfield@zepben.com>
6
6
  License-Expression: MPL-2.0
@@ -628,14 +628,14 @@ zepben/ewb/streaming/grpc/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU
628
628
  zepben/ewb/streaming/grpc/auth_token_plugin.py,sha256=zg3UJF9qJ_Ov7Pczjhd4B_-BKaAr35JlAFLLdm1jg7U,804
629
629
  zepben/ewb/streaming/grpc/connect.py,sha256=xRifzFzlbVuEoRY79fasGO-E-zLtGpGKUF5F9CusI6g,10504
630
630
  zepben/ewb/streaming/grpc/grpc.py,sha256=q2tncPR9jMfcOB71R5mnJi1ZVp7F3X1-NIUhf0Zw2jA,3824
631
- zepben/ewb/streaming/grpc/grpc_channel_builder.py,sha256=-NHQZxfqOMVCND7jkZOWRO6oynh1lHLm6hjHO7kRhZk,8698
631
+ zepben/ewb/streaming/grpc/grpc_channel_builder.py,sha256=k2v1zkDeDgYdc2kqdBsntEeQWHm8qqt1L62UTxnNDqw,9225
632
632
  zepben/ewb/streaming/mutations/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
633
633
  zepben/ewb/streaming/mutations/update_network_state_client.py,sha256=e0Oma5PRT8mW7EQs-zGVIQYpT-LxAz-mQ579LBevW-c,3922
634
634
  zepben/ewb/streaming/mutations/update_network_state_service.py,sha256=irR-TO67QXRyBmK8PU8SzM31NKSSefZt_nQGHi5IhT8,3260
635
635
  zepben/ewb/testing/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
636
636
  zepben/ewb/testing/test_network_builder.py,sha256=KG0o2ZHUswx3xClu-JnLs_pYIYbQ5jjtvtyZ7LI6IZ8,38092
637
- zepben_ewb-1.0.0b6.dist-info/licenses/LICENSE,sha256=aAHD66h6PQIETpkJDvg5yEObyFvXUED8u7S8dlh6K0Y,16725
638
- zepben_ewb-1.0.0b6.dist-info/METADATA,sha256=Rm_p0aRZCBv3XaE_tldT6CJ30MCiXSB9cwcd3OFqFc4,3300
639
- zepben_ewb-1.0.0b6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
640
- zepben_ewb-1.0.0b6.dist-info/top_level.txt,sha256=eVLDJiO6FGjL_Z7KdmFE-R8uf1Q07aaVLGe9Ee4kmBw,7
641
- zepben_ewb-1.0.0b6.dist-info/RECORD,,
637
+ zepben_ewb-1.0.0b7.dist-info/licenses/LICENSE,sha256=aAHD66h6PQIETpkJDvg5yEObyFvXUED8u7S8dlh6K0Y,16725
638
+ zepben_ewb-1.0.0b7.dist-info/METADATA,sha256=3STVNHTFz_Fii6k50mCE5WKGNcqr_eTfERhKAL8J8vQ,3300
639
+ zepben_ewb-1.0.0b7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
640
+ zepben_ewb-1.0.0b7.dist-info/top_level.txt,sha256=eVLDJiO6FGjL_Z7KdmFE-R8uf1Q07aaVLGe9Ee4kmBw,7
641
+ zepben_ewb-1.0.0b7.dist-info/RECORD,,