public static void recordParserFailure(Parser parser, Throwable failure, Metadata metadata) {
        String trace = ExceptionUtils.getStackTrace(failure);
        metadata.add(EMBEDDED_EXCEPTION, trace);
        metadata.add(EMBEDDED_PARSER, getParserClassname(parser));
    }
Records details of a {@link Parser}'s failure to the
{@link Metadata}, so you can check what went wrong even if the
{@link Exception} wasn't immediately thrown (eg when several different
Parsers are used)
tika-core/src/main/java/org/apache/tika/utils/ParserUtils.java