Skip to content

Commit 7618962

Browse files
author
Filip Knefel
committed
Drop custom errors for HTTP exceptions
1 parent d481296 commit 7618962

File tree

1 file changed

+3
-13
lines changed
  • unstructured_platform_plugins/etl_uvicorn

1 file changed

+3
-13
lines changed

unstructured_platform_plugins/etl_uvicorn/errors.py

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

2222

23-
class UnprocessableEntityError(UserError):
24-
status_code: int = 422
25-
26-
2723
class RateLimitError(UserError):
2824
status_code: int = 429
2925

@@ -45,16 +41,10 @@ class CatchAllError(BaseError):
4541

4642

4743
def wrap_error(e: Exception) -> HTTPException:
48-
if isinstance(e, ingest_errors.UserAuthError):
49-
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)
44+
if isinstance(e, HTTPException):
5745
return e
46+
elif isinstance(e, ingest_errors.UserAuthError):
47+
return UserAuthError(e)
5848
elif isinstance(e, ingest_errors.RateLimitError):
5949
return RateLimitError(e)
6050
elif isinstance(e, ingest_errors.QuotaError):

0 commit comments

Comments
 (0)