Author: shawkins
Date: 2012-04-03 05:04:40 -0400 (Tue, 03 Apr 2012)
New Revision: 3965
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
branches/7.7.x/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java
Log:
TEIID-1987 fix to expose underlying exception
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2012-04-03
03:44:41 UTC (rev 3964)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2012-04-03
09:04:40 UTC (rev 3965)
@@ -37,6 +37,7 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
@@ -623,4 +624,18 @@
return null;
}
+ public static void unwrapException(TeiidRuntimeException e)
+ throws TeiidComponentException, TeiidProcessingException {
+ if (e == null) {
+ return;
+ }
+ if (e.getCause() instanceof TeiidComponentException) {
+ throw (TeiidComponentException)e.getCause();
+ }
+ if (e.getCause() instanceof TeiidProcessingException) {
+ throw (TeiidProcessingException)e.getCause();
+ }
+ throw e;
+ }
+
}
\ No newline at end of file
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2012-04-03
03:44:41 UTC (rev 3964)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2012-04-03
09:04:40 UTC (rev 3965)
@@ -244,20 +244,6 @@
}
}
- private void unwrapException(TeiidRuntimeException e)
- throws TeiidComponentException, TeiidProcessingException {
- if (e == null) {
- return;
- }
- if (e.getCause() instanceof TeiidComponentException) {
- throw (TeiidComponentException)e.getCause();
- }
- if (e.getCause() instanceof TeiidProcessingException) {
- throw (TeiidProcessingException)e.getCause();
- }
- throw e;
- }
-
private List<?> processRow() throws ExpressionEvaluationException,
BlockedException,
TeiidComponentException, TeiidProcessingException {
List<Object> tuple = new ArrayList<Object>(projectedColumns.size());
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java 2012-04-03
03:44:41 UTC (rev 3964)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java 2012-04-03
09:04:40 UTC (rev 3965)
@@ -46,12 +46,15 @@
import nux.xom.xquery.StreamingPathFilter;
import nux.xom.xquery.StreamingTransform;
+import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.TeiidRuntimeException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.source.XMLSystemFunctions;
+import org.teiid.query.processor.relational.RelationalNode;
import org.teiid.query.util.CommandContext;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression.RowProcessor;
@@ -69,7 +72,7 @@
}
};
- public static SaxonXQueryExpression.Result evaluateXQuery(final SaxonXQueryExpression
xquery, Object context, Map<String, Object> parameterValues, final RowProcessor
processor, CommandContext commandContext) throws TeiidProcessingException {
+ public static SaxonXQueryExpression.Result evaluateXQuery(final SaxonXQueryExpression
xquery, Object context, Map<String, Object> parameterValues, final RowProcessor
processor, CommandContext commandContext) throws TeiidProcessingException,
TeiidComponentException {
DynamicQueryContext dynamicContext = new DynamicQueryContext(xquery.config);
SaxonXQueryExpression.Result result = new SaxonXQueryExpression.Result();
@@ -121,6 +124,9 @@
builder.build(FAKE_IS);
return result;
} catch (ParsingException e) {
+ if (e.getCause() instanceof TeiidRuntimeException) {
+ RelationalNode.unwrapException((TeiidRuntimeException)e.getCause());
+ }
throw new TeiidProcessingException(e,
QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
} catch (IOException e) {
throw new TeiidProcessingException(e,
QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
Show replies by date