Azure / Azure/azure-sdk-for-python

Question: Error handling in Document Intelligence client library

Open
#43,085 7 comments 0 reactions 1 assignee Claimed by @yungshinlintw View on GitHub
Client customer-reported Document Intelligence needs-team-attention question
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

Using the synchronous blocking Document Intelligence client library for Python, not the async package.

Version:
azure-ai-documentintelligence==1.0.2

```
def _analyze_document(self, f, output_content_format=None) -> AnalyzeResult:
poller = self.document_intelligence_client.begin_analyze_document("prebuilt-layout", f, content_type="application/octet-stream", output_content_format=output_content_format)
result: AnalyzeResult = poller.result()
return result
```

The code above is based on the Microsoft examples here:
https://azuresdkdocs.z19.web.core.windows.net/python/azure-ai-documentintelligence/1.0.2/index.html#examples

The example code snippets do not have any retry logic or any exception handling.

Does the poller.result() method internally handle exceptions and retries?

I'm not using the async IO package. What is the right way to handle rate limiting errors and other errors when using the service?

If this is documented somewhere, please point me to the documentation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.