Skip to content

[Monitor] Make Monitor exception handler case insensitive.#6301

Merged
troydai merged 1 commit into
Azure:devfrom
tjprescott:MonitorCreateError
May 8, 2018
Merged

[Monitor] Make Monitor exception handler case insensitive.#6301
troydai merged 1 commit into
Azure:devfrom
tjprescott:MonitorCreateError

Conversation

@tjprescott
Copy link
Copy Markdown
Member

@tjprescott tjprescott commented May 7, 2018

Partially address #6120. Makes the Monitor exception handling logic case-insensitive for the payload keys to ensure that the Code is displayed as intended.

The rest of that issue belongs with the service team.


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@tjprescott tjprescott added this to the Sprint 37 milestone May 7, 2018
@tjprescott tjprescott requested a review from troydai May 7, 2018 20:06
@promptws
Copy link
Copy Markdown

promptws commented May 7, 2018

View a preview at https://prompt.ws/r/Azure/azure-cli/6301
This is an experimental preview for @microsoft users.

error_payload = {k.lower(): v for k, v in error_payload.items()}
if 'code' in error_payload and 'message' in error_payload:
message = '{}.'.format(error_payload['message']) if error_payload['message'] else 'Operation failed.'
code = '[Code: "{}"]'.format(error_payload['code']) if error_payload['code'] else ''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was it a service change?

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.

Probably just general service inconsistency would be my guess.

@troydai troydai merged commit 558691b into Azure:dev May 8, 2018
@tjprescott tjprescott deleted the MonitorCreateError branch May 8, 2018 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants