|
11 | 11 | from urlparse import urlparse # type: ignore
|
12 | 12 |
|
13 | 13 | from azure.core.tracing.decorator import distributed_trace
|
14 |
| -from azure.core.exceptions import HttpResponseError |
15 | 14 |
|
16 | 15 | from ._chat_thread_client import ChatThreadClient
|
17 | 16 | from ._common import CommunicationUserCredentialPolicy
|
@@ -152,15 +151,18 @@ def create_chat_thread(
|
152 | 151 | participants = [m._to_generated() for m in thread_participants] # pylint:disable=protected-access
|
153 | 152 | create_thread_request = CreateChatThreadRequest(topic=topic, participants=participants)
|
154 | 153 |
|
155 |
| - response, create_chat_thread_result = self._client.create_chat_thread(create_thread_request, cls=return_response, **kwargs) |
| 154 | + response, create_chat_thread_result = self._client.create_chat_thread( |
| 155 | + create_thread_request, cls=return_response, **kwargs) |
156 | 156 | if response is not None:
|
157 | 157 | response_header = response.http_response.headers
|
158 |
| - if 'Azure-Acs-InvalidParticipants' in response_header.keys() and response_header['Azure-Acs-InvalidParticipants'] is not None: |
| 158 | + if ('Azure-Acs-InvalidParticipants' in response_header.keys() and |
| 159 | + response_header['Azure-Acs-InvalidParticipants'] is not None): |
159 | 160 | invalid_participant_and_reason_list = response_header['Azure-Acs-InvalidParticipants'].split('|')
|
160 | 161 | errors = []
|
161 | 162 | for invalid_participant_and_reason in invalid_participant_and_reason_list:
|
162 | 163 | participant, reason = invalid_participant_and_reason.split(',', 1)
|
163 |
| - errors.append('participant ' + participant + ' failed to join thread ' + create_chat_thread_result.id + ' return statue code ' + reason) |
| 164 | + errors.append('participant ' + participant + ' failed to join thread ' |
| 165 | + + create_chat_thread_result.id + ' return statue code ' + reason) |
164 | 166 | raise ValueError(errors)
|
165 | 167 | return ChatThreadClient(
|
166 | 168 | endpoint=self._endpoint,
|
|
0 commit comments