docling-java
docling-java copied to clipboard
Async task failure hides the error message returned by Docling Serve
When an async conversion or chunking task fails, convertSourceAsync, convertSourceBatchAsync, chunkSourceWithHierarchicalChunkerAsync and chunkSourceWithHybridChunkerAsync complete exceptionally with a message built from task_meta only:
Async conversion failed for task <id>: Task failed: TaskStatusMetadata(numDocs=1, numProcessed=1, numSucceeded=0, numFailed=1)
The task metadata only holds document counts, so the cause of the failure is lost. Docling Serve returns the cause in the error_message field of the status poll response, but TaskStatusPollResponse has no field for it and the client ignores it.
Steps to reproduce
-
Submit an async conversion that fails on the server.
-
Poll response from
/v1/status/poll/{task_id}:{ "task_id": "task-1", "task_status": "failure", "task_meta": {"num_docs": 1, "num_processed": 1, "num_succeeded": 0, "num_failed": 1}, "error_message": "Input document is not valid" } -
The future fails with
... Task failed: TaskStatusMetadata(numDocs=1, ...).
Expected behavior
The exception message includes Input document is not valid.
Environment
- docling-java
main(0.7.2-SNAPSHOT) - Java 17+