private static Throwable unwrapException(TranscoderException ex) { // The TranscoderException is generally useless... return ex.getException() != null ? ex.getException() : ex; }
/** * Receive notification of a successfully completed DOM tree generation. */ public void notify(Document doc) throws SAXException { try { TranscoderInput transInput = new TranscoderInput(doc); // Buffering is done by the pipeline (See shouldSetContentLength) TranscoderOutput transOutput = new TranscoderOutput(this.output); transcoder.transcode(transInput, transOutput); } catch (TranscoderException ex) { if (ex.getException() != null) { if (getLogger().isDebugEnabled()) { getLogger().debug("Got transcoder exception writing image, rethrowing nested exception", ex); } throw new SAXException("Exception writing image", ex.getException()); } if (getLogger().isDebugEnabled()) { getLogger().debug("Got transcoder exception writing image, rethrowing", ex); } throw new SAXException("Exception writing image", ex); } catch (Exception ex) { if (getLogger().isDebugEnabled()) { getLogger().debug("Got exception writing image, rethrowing", ex); } throw new SAXException("Exception writing image", ex); } }