File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
unstructured_platform_plugins/etl_uvicorn Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,24 @@ class ProviderError(BaseError):
3636 status_code : int = 500
3737
3838
39+ class GatewayTimeoutError (BaseError ):
40+ status_code : int = 504
41+
42+
3943class CatchAllError (BaseError ):
4044 status_code : int = 512
4145
4246
4347def wrap_error (e : Exception ) -> HTTPException :
4448 if isinstance (e , ingest_errors .UserAuthError ):
4549 return UserAuthError (e )
46- elif isinstance (e , ingest_errors .UnprocessableEntityError ):
47- return UnprocessableEntityError (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 )
4857 elif isinstance (e , ingest_errors .RateLimitError ):
4958 return RateLimitError (e )
5059 elif isinstance (e , ingest_errors .QuotaError ):
You can’t perform that action at this time.
0 commit comments