Skip to content

Commit cc5aa90

Browse files
authored
fix: use wrap_error for proper status codes in streaming response (#58)
1 parent 93bce15 commit cc5aa90

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.36" # pragma: no cover
1+
__version__ = "0.0.37" # pragma: no cover

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,15 @@ async def _stream_response():
186186
)
187187
except Exception as e:
188188
logger.error(f"Failure streaming response: {e}", exc_info=True)
189+
http_error = wrap_error(e)
189190
yield (
190191
InvokeResponse(
191192
usage=usage,
192193
message_channels=message_channels,
193194
filedata_meta=filedata_meta_model.model_validate(
194195
filedata_meta.model_dump()
195196
),
196-
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
197+
status_code=http_error.status_code,
197198
status_code_text=f"[{e.__class__.__name__}] {e}",
198199
).model_dump_json()
199200
+ "\n"

0 commit comments

Comments
 (0)