Author: mrglavas
Date: Wed Oct 27 02:55:35 2010
New Revision: 1027805
URL: http://svn.apache.org/viewvc?rev=1027805&view=rev
Log:
Fixing a bug on the error handling path for StAX input. XMLStreamReaders cannot
directly throw an IOException, so we need to check before re-throwing the
exception whether it wraps an IOException and if it does possibly only report a
warning.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=1027805&r1=1027804&r2=1027805&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Wed Oct 27 02:55:35 2010
@@ -2406,9 +2406,15 @@ public class XSDHandler {
return getSchemaDocument0(key, schemaId, schemaElement);
}
catch (XMLStreamException e) {
- StAXLocationWrapper slw = new StAXLocationWrapper();
- slw.setLocation(e.getLocation());
- throw new XMLParseException(slw, e.getMessage(), e);
+ Throwable t = e.getNestedException();
+ if (t instanceof IOException) {
+ exception = (IOException) t;
+ }
+ else {
+ StAXLocationWrapper slw = new StAXLocationWrapper();
+ slw.setLocation(e.getLocation());
+ throw new XMLParseException(slw, e.getMessage(), e);
+ }
}
catch (IOException e) {
exception = e;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]