private ParseContext setupParseContext(FetchEmitTuple fetchEmitTuple)
            throws TikaConfigException {
        ParseContext parseContext = fetchEmitTuple.getParseContext();
        if (parseContext.get(HandlerConfig.class) == null) {
            parseContext.set(HandlerConfig.class, HandlerConfig.DEFAULT_HANDLER_CONFIG);
        }
        EmbeddedDocumentBytesConfig embeddedDocumentBytesConfig = parseContext.get(EmbeddedDocumentBytesConfig.class);
        if (embeddedDocumentBytesConfig == null) {
            //make sure there's one here -- or do we make this default in fetchemit tuple?
            parseContext.set(EmbeddedDocumentBytesConfig.class, EmbeddedDocumentBytesConfig.SKIP);
            return parseContext;
        }
        EmbeddedDocumentExtractorFactory factory = ((AutoDetectParser)autoDetectParser)
                .getAutoDetectParserConfig().getEmbeddedDocumentExtractorFactory();
        if (factory == null) {
            parseContext.set(EmbeddedDocumentExtractor.class, new RUnpackExtractor(parseContext,
                    RUnpackExtractorFactory.DEFAULT_MAX_EMBEDDED_BYTES_FOR_EXTRACTION));
        } else {
            if (! (factory instanceof EmbeddedDocumentByteStoreExtractorFactory)) {
                throw new TikaConfigException("EmbeddedDocumentExtractorFactory must be an " +
                        "instance of EmbeddedDocumentByteStoreExtractorFactory if you want" +
                        "to extract embedded bytes! I see this embedded doc factory: " +
                        factory.getClass() + "and a request: " +
                        embeddedDocumentBytesConfig);
            }
        }
        //TODO: especially clean this up.
        if (!StringUtils.isBlank(embeddedDocumentBytesConfig.getEmitter())) {
            parseContext.set(EmbeddedDocumentBytesHandler.class,
                    new EmittingEmbeddedDocumentBytesHandler(fetchEmitTuple, emitterManager));
        } else {
            parseContext.set(EmbeddedDocumentBytesHandler.class,
                    new BasicEmbeddedDocumentBytesHandler(
                    embeddedDocumentBytesConfig));
        }
        return parseContext;
    }
returns stack trace if there was a container exception or empty string
if there was no stacktrace

@param t
@param metadataList
@return
tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java