Unstructured-IO / unstructured-api

Apache License 2.0
528 stars 110 forks source link

Feature request: Add structured response for parsing errors #326

Closed flash1293 closed 10 months ago

flash1293 commented 10 months ago

Currently, errors that are caused by the file to partition and errors in calling the API are handled the same way.

For example:

The first two errors are caused by bad data in the pipeline, while the third one is a bug in the code calling the API. It would be great if there would be a way to programmatically differentiate these situations to react appropriately. It seems like a status code 422 for the case of corrupted files would make sense.