Skip to content

Commit db59eed

Browse files
committed
Handle 422 errors
1 parent 6bb5f16 commit db59eed

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.32" # pragma: no cover
1+
__version__ = "0.0.33" # pragma: no cover

unstructured_platform_plugins/etl_uvicorn/errors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class UserAuthError(UserError):
2020
status_code: int = 403
2121

2222

23+
class UnprocessableEntityError(UserError):
24+
status_code: int = 422
25+
26+
2327
class RateLimitError(UserError):
2428
status_code: int = 429
2529

@@ -39,6 +43,8 @@ class CatchAllError(BaseError):
3943
def wrap_error(e: Exception) -> HTTPException:
4044
if isinstance(e, ingest_errors.UserAuthError):
4145
return UserAuthError(e)
46+
elif isinstance(e, ingest_errors.UnprocessableEntityError):
47+
return UnprocessableEntityError(e)
4248
elif isinstance(e, ingest_errors.RateLimitError):
4349
return RateLimitError(e)
4450
elif isinstance(e, ingest_errors.QuotaError):

0 commit comments

Comments
 (0)