Skip to content

Commit 83bd4a7

Browse files
authored
Nex-80: get rid of 512 UnrecoverableException (#59)
### Summary Remove UnrecoverableException and 512 ### Notes for the record I also want to remove function `wrap_error` entirely but we need them for now for all ingest error status code... this design is too much layers -> i would suggest ingest to have a parent error class like the client and then have error code defined in ingest -> not here wrapper
1 parent cc5aa90 commit 83bd4a7

File tree

4 files changed

+2
-17
lines changed

4 files changed

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

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
get_schema_dict,
2626
map_inputs,
2727
)
28-
from unstructured_platform_plugins.exceptions import UnrecoverableException
2928
from unstructured_platform_plugins.schema import FileDataMeta, NewRecord, UsageData
3029
from unstructured_platform_plugins.schema.json_schema import (
3130
schema_to_base_model,
@@ -225,16 +224,6 @@ async def _stream_response():
225224
else exc.detail,
226225
file_data=request_dict.get("file_data", None),
227226
)
228-
except UnrecoverableException as ex:
229-
logger.info("Unrecoverable error occurred during plugin invocation")
230-
return InvokeResponse(
231-
usage=usage,
232-
message_channels=message_channels,
233-
status_code=512,
234-
status_code_text=ex.message,
235-
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
236-
file_data=request_dict.get("file_data", None),
237-
)
238227
except Exception as invoke_error:
239228
logger.error(f"failed to invoke plugin: {invoke_error}", exc_info=True)
240229
http_error = wrap_error(invoke_error)

unstructured_platform_plugins/etl_uvicorn/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ProviderError(BaseError):
3333

3434

3535
class CatchAllError(BaseError):
36-
status_code: int = 512
36+
status_code: int = 500
3737

3838

3939
def wrap_error(e: Exception) -> HTTPException:

unstructured_platform_plugins/exceptions.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)