Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.11

* **Bugfix: Add UnrecoverableException exception handling back**

## 0.0.10

* **Bugfix: Add `None` support in mapping `FileDataMeta` response**
Expand Down
4 changes: 4 additions & 0 deletions unstructured_platform_plugins/etl_uvicorn/api_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
get_schema_dict,
map_inputs,
)
from unstructured_platform_plugins.exceptions import UnrecoverableException
from unstructured_platform_plugins.schema import FileDataMeta, NewRecord, UsageData
from unstructured_platform_plugins.schema.json_schema import (
schema_to_base_model,
Expand Down Expand Up @@ -158,6 +159,9 @@ async def _stream_response():
status_code=status.HTTP_200_OK,
output=output,
)
except UnrecoverableException as ex:
logger.info("Unrecoverable error occurred during plugin invocation")
return InvokeResponse(usage=usage, status_code=512, status_code_text=ex.message)
except Exception as invoke_error:
logger.error(f"failed to invoke plugin: {invoke_error}", exc_info=True)
return InvokeResponse(
Expand Down
Loading