Skip to content

Commit 6915429

Browse files
authored
[ARM] Fix #31581: az deployment group create: Fix error message being hidden when template validation fails (#31965)
1 parent 1d65ac3 commit 6915429

File tree

1 file changed

+1
-6
lines changed
  • src/azure-cli/azure/cli/command_modules/resource

1 file changed

+1
-6
lines changed

src/azure-cli/azure/cli/command_modules/resource/_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,7 @@ def _build_preflight_error_message(preflight_error):
8787

8888

8989
def _build_http_response_error_message(http_error):
90-
from azure.core.exceptions import StreamClosedError, StreamConsumedError
91-
try:
92-
error_txt = http_error.response.internal_response.text
93-
error_info = json.loads(error_txt)['error']
94-
except (StreamClosedError, StreamConsumedError):
95-
error_info = http_error.response.json()['error']
90+
error_info = http_error.response.json()['error']
9691
error_details = error_info.pop('details') if 'details' in error_info else []
9792
err_messages = [f'{json.dumps(error_info)}']
9893

0 commit comments

Comments
 (0)