Skip to content

Commit 9d40844

Browse files
committed
temp
1 parent d2d4373 commit 9d40844

File tree

3 files changed

+6
-16
lines changed

3 files changed

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

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ async def _stream_response():
216216
usage=usage,
217217
message_channels=message_channels,
218218
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
219-
status_code=wrap_error(exc).status_code,
220-
status_code_text=f"[{exc.__class__.__name__}] {exc}",
219+
status_code=exc.status_code,
220+
status_code_text=exc.detail,
221221
file_data=request_dict.get("file_data", None),
222222
)
223223
except UnrecoverableException as ex:

unstructured_platform_plugins/etl_uvicorn/errors.py

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

2222

23-
class UnprocessableEntityError(UserError):
24-
status_code: int = 422
25-
2623

2724
class RateLimitError(UserError):
2825
status_code: int = 429
@@ -36,24 +33,17 @@ class ProviderError(BaseError):
3633
status_code: int = 500
3734

3835

39-
class GatewayTimeoutError(BaseError):
40-
status_code: int = 504
41-
4236

4337
class CatchAllError(BaseError):
4438
status_code: int = 512
4539

4640

4741
def wrap_error(e: Exception) -> HTTPException:
42+
"""
43+
Wraps an exception in a HTTPException.
44+
"""
4845
if isinstance(e, ingest_errors.UserAuthError):
4946
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)
5747
elif isinstance(e, ingest_errors.RateLimitError):
5848
return RateLimitError(e)
5949
elif isinstance(e, ingest_errors.QuotaError):

0 commit comments

Comments
 (0)