/** * Find the most contained message. * * @return The error message of the originating exception. */ public String getMessage() { String lastMessage = super.getMessage(); Throwable exception = m_exception; while (null != exception) { String nextMessage = exception.getMessage(); if (null != nextMessage) lastMessage = nextMessage; if (exception instanceof TransformerException) { TransformerException se = (TransformerException) exception; Throwable prev = exception; exception = se.getException(); if (prev == exception) break; } else { exception = null; } } return (null != lastMessage) ? lastMessage : ""; }
/** * Find the most contained message. * * @return The error message of the originating exception. */ public String getMessage() { String lastMessage = super.getMessage(); Throwable exception = m_exception; while (null != exception) { String nextMessage = exception.getMessage(); if (null != nextMessage) lastMessage = nextMessage; if (exception instanceof TransformerException) { TransformerException se = (TransformerException) exception; Throwable prev = exception; exception = se.getException(); if (prev == exception) break; } else { exception = null; } } return (null != lastMessage) ? lastMessage : ""; }
Throwable prev = exception; exception = se.getException();
Throwable prev = exception; exception = se.getException();
Throwable prev = exception; exception = se.getException();
Throwable prev = exception; exception = se.getException();
/** * Receive notification of a recoverable error. * The transformer must continue to provide normal parsing events after * invoking this method. It should still be possible for the application * to process the document through to the end. * * @param e The warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
/** * Receive notification of a warning. * Transformers can use this method to report conditions that are not * errors or fatal errors. The default behaviour is to take no action. * After invoking this method, the Transformer must continue with the * transformation. It should still be possible for the application to * process the document through to the end. * * @param e The warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (never does in our case). */ public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
/** * Receive notification of a recoverable error. * The transformer must continue to provide normal parsing events after * invoking this method. It should still be possible for the application * to process the document through to the end. * * @param e The warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
/** * Receive notification of a non-recoverable error. * The application must assume that the transformation cannot continue * after the Transformer has invoked this method, and should continue * (if at all) only to collect addition error messages. In fact, * Transformers are free to stop reporting events once this method has * been invoked. * * @param e The warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
/** * Receive notification of a warning. * Transformers can use this method to report conditions that are not * errors or fatal errors. The default behaviour is to take no action. * After invoking this method, the Transformer must continue with the * transformation. It should still be possible for the application to * process the document through to the end. * * @param e The warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (never does in our case). */ public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
/** * Receive notification of a non-recoverable error. * The application must assume that the transformation cannot continue * after the Transformer has invoked this method, and should continue * (if at all) only to collect addition error messages. In fact, * Transformers are free to stop reporting events once this method has * been invoked. * * @param e warning information encapsulated in a transformer * exception. * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException;
+ locator.getColumnNumber()); e = spe2.getException();
+ locator.getColumnNumber()); e = spe2.getException();