Igor,
Try starting the server with the -s or –includeStack option.
That should return the stacktrace for normal parsing errors like the one you
eventually found below.
If that doesn’t work for your document, please open an issue.
Best,
Tim
From: Igor Gomes dos Santos [mailto:[email protected]]
Sent: Tuesday, December 27, 2016 9:50 PM
To: [email protected]
Subject: Is it possible to get more helpful error responses in the REST API?
Hi there!
We're currently using Tika over its REST API, and one specific document
returned 422, with no specific details. Well, from a user point of view, this
is similar to a 400, as it doesn't explain exactly what caused the issue, nor
the documentation - linking 422 to general problems like encoding or encrypted
issues.
Having said that, I could dig around the logs and found a (big) stack trace,
and somewhere inside it a message stating "Caused by:
org.apache.poi.poifs.filesystem.NotOLE2FileException: Invalid header signature;
read 0x35322D622D2D213C, expected 0xE11AB1A1E011CFD0 - Your file appears not to
be a valid OLE2 document".
Cool! I found my issue! But not without digging. As I said, an empty-body 422
response is rather meaningless.
I was wondering if there's a way to get such error messages (that "caused by"
thing, or even the entire stack trace) in the error response body through
configuring something, or should I open an issue requesting that feature?
Thanks in advance,
Igor Santos
PHP / React Developer @ Toptal - the top 3% of freelancer
talent<http://www.toptal.com/#obtain-only-eye-opening-coders-now>
igorsantos.com.br<http://www.igorsantos.com.br/>