Skip to content

Commit 8cbbecc

Browse files
committed
format
Signed-off-by: Patrick Assuied <[email protected]>
1 parent 17f688a commit 8cbbecc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

dapr/clients/exceptions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def __init__(
133133
error_code = error_info.get('errorCode') or ERROR_CODE_UNKNOWN
134134

135135
super().__init__(
136-
message or f'HTTP status code: {status_code}',
137-
error_code,
138-
raw_response_bytes
136+
message or f'HTTP status code: {status_code}', error_code, raw_response_bytes
139137
)
140138

141139
@property
@@ -154,7 +152,7 @@ def as_dict(self):
154152

155153
def __str__(self):
156154
if self._error_code != ERROR_CODE_UNKNOWN:
157-
return f"{self._message} (Error Code: {self._error_code}, Status Code: {self._status_code})"
155+
return f'{self._message} (Error Code: {self._error_code}, Status Code: {self._status_code})'
158156
else:
159157
return f'Unknown Dapr Error. HTTP status code: {self._status_code}.'
160158

tests/clients/test_http_service_invocation_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def test_invoke_method_error_returned(self):
208208
error_response = b'{"errorCode":"ERR_DIRECT_INVOKE","message":"Something bad happened"}'
209209
self.server.set_response(error_response, 500)
210210

211-
expected_msg = "Something bad happened (Error Code: ERR_DIRECT_INVOKE, Status Code: 500)"
211+
expected_msg = 'Something bad happened (Error Code: ERR_DIRECT_INVOKE, Status Code: 500)'
212212

213213
with self.assertRaises(DaprInternalError) as ctx:
214214
self.client.invoke_method(

0 commit comments

Comments
 (0)