Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the azure service is unavailable, the error message returned does not contain the error node #464

Closed
wants to merge 6 commits into from

Conversation

zjy282
Copy link
Contributor

@zjy282 zjy282 commented Aug 1, 2023

Describe the change
The Json deserialization function of the custom structure ErrorResponse returns the correct and expected message copy for the case where there is no error node in the APIError return information.

Describe your solution
In the custom ErrorResponse structure json deserialization function, judge whether the error node is included, if not, get the message node as the error message, if not, use the response body as the error message.

Tests
Please refer to the TestErrorResponse function in error_test.go.

Issue: When the azure service is unavailable, the error message returned does not contain the error node
For example:

{
    "statusCode": 500,
    "message": "Internal server error",
    "activityId": ""
}

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #464 (4c75ca8) into master (71a2493) will decrease coverage by 0.35%.
The diff coverage is 82.35%.

@@            Coverage Diff             @@
##           master     #464      +/-   ##
==========================================
- Coverage   97.05%   96.71%   -0.35%     
==========================================
  Files          17       17              
  Lines         714      731      +17     
==========================================
+ Hits          693      707      +14     
- Misses         15       17       +2     
- Partials        6        7       +1     
Files Changed Coverage Δ
error.go 95.16% <82.35%> (-4.84%) ⬇️

@zjy282 zjy282 closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant