Skip to content

Add Internal Error Types and Map to Public Types in Storage#41585

Merged
alzimmermsft merged 4 commits intoAzure:mainfrom
alzimmermsft:AzStorage_FixExceptionDeserializationIssue
Aug 22, 2024
Merged

Add Internal Error Types and Map to Public Types in Storage#41585
alzimmermsft merged 4 commits intoAzure:mainfrom
alzimmermsft:AzStorage_FixExceptionDeserializationIssue

Conversation

@alzimmermsft
Copy link
Member

@alzimmermsft alzimmermsft commented Aug 21, 2024

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 Object as the exception value, which leads azure-core attempting to deserialize into Object which doesn't have support. This also meant if a customer were to interact with the exception type the value would have no immediate meaning as Object is 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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@alzimmermsft alzimmermsft self-assigned this Aug 21, 2024
@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Aug 21, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Aug 21, 2024

API change check

API changes are not detected in this pull request.

@alzimmermsft alzimmermsft marked this pull request as ready for review August 21, 2024 21:19
@alzimmermsft
Copy link
Member Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alzimmermsft alzimmermsft merged commit db5dea7 into Azure:main Aug 22, 2024
@alzimmermsft alzimmermsft deleted the AzStorage_FixExceptionDeserializationIssue branch August 22, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments