Skip to content

Improve Error Messaging for Unsupported Zones in SDK #36841

@shashankqv

Description

@shashankqv

When using the Azure Document Intelligence Python SDK, I encountered a ResourceNotFoundError with a 404 status code. After spending a full day debugging, I found out that the error was due to the Zone I selected when creating the Document Intelligence resource being unsupported. However, the error message did not explicitly mention that the issue was related to the unsupported Zone, leading to unnecessary time spent troubleshooting.

I would like the exception message to explicitly indicate when a Zone or Location selected for the Document Intelligence resource is not supported. This could save developers significant time by providing more specific guidance on why the resource is not found.

An alternative could be to provide a warning or validation during the resource creation process in the Azure Portal if a user selects a Zone or Location that is not supported by the Document Intelligence service.

context

Created a document intelligence resource on Azure portal & got 2 Keys, Location/Region & an endpoint.
Documentation URL - https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/quickstarts/get-started-sdks-rest-api?view=doc-intel-4.0.0&pivots=programming-language-python#prebuilt-model

Current Error message Structure :

Screenshot 2024-08-11 at 1 22 41 AM
azure.core.exceptions.ResourceNotFoundError: (404) Resource not found
Code: 404
Message: Resource not found
python-BaseException

Proposed Error message Structure :

azure.core.exceptions.ResourceNotFoundError: (404) Resource not found 
Code: 404
Message: Resource not found (Zone not supported as of now, consider recreating document intelligent resource with the supported Zones)
python-BaseException

Explicitly stating this in the error message would improve the developer experience.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Document IntelligenceService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions