Add Internal Error Types and Map to Public Types in Storage#41585
Merged
alzimmermsft merged 4 commits intoAzure:mainfrom Aug 22, 2024
Merged
Conversation
Collaborator
|
API change check API changes are not detected in this pull request. |
6 tasks
ibrahimrabab
approved these changes
Aug 22, 2024
Member
Author
|
/azp run java - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds new internal exception types to the Storage SDKs to handle an issue found running performance tests where if there is an error response from the service conveyed in the HTTP response body it was running into a linkage error attempting to initialize Jackson's XmlMapper (which it can no longer do with the dependency removed).
The root cause of this issue is that the exception types that were being used in the generated code for Storage had
Objectas the exception value, which leadsazure-coreattempting to deserialize intoObjectwhich doesn't have support. This also meant if a customer were to interact with the exception type the value would have no immediate meaning asObjectis very generic.This PR prototypes a fix to this issue by using internal types to be the exception used in generated code where they have a value that is typed and contains fields based on what the Storage service returns.
Another possible solution to this issue is breaking the API of the existing Storage exceptions to use a specific typed value.Won't be done as this is a breaking change. This could be a future change if / when there are other breaking changes planned.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines