File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
unstructured_platform_plugins Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1- __version__ = "0.0.32" # pragma: no cover
1+ __version__ = "0.0.33" # pragma: no cover
Original file line number Diff line number Diff 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+
2327class RateLimitError (UserError ):
2428 status_code : int = 429
2529
@@ -32,13 +36,24 @@ class ProviderError(BaseError):
3236 status_code : int = 500
3337
3438
39+ class GatewayTimeoutError (BaseError ):
40+ status_code : int = 504
41+
42+
3543class CatchAllError (BaseError ):
3644 status_code : int = 512
3745
3846
3947def wrap_error (e : Exception ) -> HTTPException :
4048 if isinstance (e , ingest_errors .UserAuthError ):
4149 return UserAuthError (e )
50+ elif isinstance (e , HTTPException ):
51+ if e .status_code == 400 :
52+ return UserError (e )
53+ if e .status_code == 422 :
54+ return UnprocessableEntityError (e )
55+ if e .status_code == 504 :
56+ return GatewayTimeoutError (e )
4257 elif isinstance (e , ingest_errors .RateLimitError ):
4358 return RateLimitError (e )
4459 elif isinstance (e , ingest_errors .QuotaError ):
You can’t perform that action at this time.
0 commit comments