You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
## 0.41.0
2
+
3
+
### Enhancements
4
+
5
+
### Features
6
+
* Provide a base `UnstructuredClientError` to capture every error raised by the SDK. Note that some exceptions such as `SDKError` now have more information in the `message` field. This will impact any users who rely on string matching in their error handling.
Copy file name to clipboardExpand all lines: README.md
+49-40Lines changed: 49 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,26 +153,18 @@ with UnstructuredClient(
153
153
<!-- Start Error Handling [errors] -->
154
154
## Error Handling
155
155
156
-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
156
+
[`UnstructuredClientError`](./src/unstructured_client/models/errors/unstructuredclienterror.py) is the base class for all HTTP error responses. It has the following properties:
157
157
158
-
By default, an API error will raise a errors.SDKError exception, which has the following properties:
|`.raw_response`|*httpx.Response*| The raw HTTP response |
165
-
|`.body`|*str*| The response content |
166
-
167
-
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_connection_check_destinations_async` method may raise the following exceptions:
**Inherit from [`UnstructuredClientError`](./src/unstructured_client/models/errors/unstructuredclienterror.py)**:
216
+
*[`ServerError`](./src/unstructured_client/models/errors/servererror.py): Server Error. Status code `5XX`. Applicable to 1 of 29 methods.*
217
+
*[`ResponseValidationError`](./src/unstructured_client/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
218
+
219
+
</details>
220
+
221
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
201
222
<!-- End Error Handling [errors] -->
202
223
203
224
<!-- Start Custom HTTP Client [http-client] -->
@@ -316,7 +337,7 @@ with UnstructuredClient() as uc_client:
316
337
317
338
</br>
318
339
319
-
The same SDK client can also be used to make asynchronous requests by importing asyncio.
340
+
The same SDK client can also be used to make asychronous requests by importing asyncio.
320
341
```python
321
342
# Asynchronous Example
322
343
import asyncio
@@ -410,30 +431,18 @@ Certain SDK methods accept file objects as part of a request body or multi-part
410
431
411
432
```python
412
433
from unstructured_client import UnstructuredClient
0 commit comments