Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ def _build_preflight_error_message(preflight_error):


def _build_http_response_error_message(http_error):
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function now directly calls http_error.response.json()['error'] without any error handling. Consider adding appropriate exception handling for cases where the response might not contain valid JSON or the expected 'error' key structure.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is existing behaviour.

from azure.core.exceptions import StreamClosedError, StreamConsumedError
try:
error_txt = http_error.response.internal_response.text
error_info = json.loads(error_txt)['error']
except (StreamClosedError, StreamConsumedError):
error_info = http_error.response.json()['error']
error_info = http_error.response.json()['error']
error_details = error_info.pop('details') if 'details' in error_info else []
err_messages = [f'{json.dumps(error_info)}']

Expand Down