From 30b0cfcdeadcaef7b391d8bf4a095a47c1f5ee9b Mon Sep 17 00:00:00 2001 From: Nathan Van Gheem Date: Wed, 27 Nov 2024 14:05:46 -0500 Subject: [PATCH] fix exception handling --- CHANGELOG.md | 4 ++++ unstructured_platform_plugins/__version__.py | 2 +- unstructured_platform_plugins/etl_uvicorn/api_generator.py | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e67846..09cb78b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.12 + +* **Bugfix: Fix UnrecoverableException exception handling to include full response** + ## 0.0.11 * **Bugfix: Add UnrecoverableException exception handling back** diff --git a/unstructured_platform_plugins/__version__.py b/unstructured_platform_plugins/__version__.py index f30cf20..97e1281 100644 --- a/unstructured_platform_plugins/__version__.py +++ b/unstructured_platform_plugins/__version__.py @@ -1 +1 @@ -__version__ = "0.0.11" # pragma: no cover +__version__ = "0.0.12" # pragma: no cover diff --git a/unstructured_platform_plugins/etl_uvicorn/api_generator.py b/unstructured_platform_plugins/etl_uvicorn/api_generator.py index 29648b6..a9dd8b0 100644 --- a/unstructured_platform_plugins/etl_uvicorn/api_generator.py +++ b/unstructured_platform_plugins/etl_uvicorn/api_generator.py @@ -161,7 +161,12 @@ async def _stream_response(): ) except UnrecoverableException as ex: logger.info("Unrecoverable error occurred during plugin invocation") - return InvokeResponse(usage=usage, status_code=512, status_code_text=ex.message) + return InvokeResponse( + usage=usage, + status_code=512, + status_code_text=ex.message, + filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()), + ) except Exception as invoke_error: logger.error(f"failed to invoke plugin: {invoke_error}", exc_info=True) return InvokeResponse(