Skip to content

Commit da6e631

Browse files
committed
Add UnrecoverableException exception handling back
1 parent 19e8cfa commit da6e631

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.11
2+
3+
* **Bugfix: Add UnrecoverableException exception handling back**
4+
15
## 0.0.10
26

37
* **Bugfix: Add `None` support in mapping `FileDataMeta` response**

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from unstructured_ingest.v2.interfaces import FileData
1515
from uvicorn.config import LOG_LEVELS
1616
from uvicorn.importer import import_from_string
17+
from unstructured_platform_plugins.exceptions import UnrecoverableException
1718

1819
from unstructured_platform_plugins.etl_uvicorn.otel import get_metric_provider, get_trace_provider
1920
from unstructured_platform_plugins.etl_uvicorn.utils import (
@@ -158,6 +159,9 @@ async def _stream_response():
158159
status_code=status.HTTP_200_OK,
159160
output=output,
160161
)
162+
except UnrecoverableException as ex:
163+
logger.info("Unrecoverable error occurred during plugin invocation")
164+
return InvokeResponse(usage=usage, status_code=512, status_code_text=ex.message)
161165
except Exception as invoke_error:
162166
logger.error(f"failed to invoke plugin: {invoke_error}", exc_info=True)
163167
return InvokeResponse(

0 commit comments

Comments
 (0)