7144423: StAX EventReader swallows the cause of error
Make sure the cause of the error is properly reported Reviewed-by: lancea, psandoz
This commit is contained in:
parent
e881068530
commit
94d67fa6a5
@ -248,8 +248,11 @@ public class XMLEventReaderImpl implements javax.xml.stream.XMLEventReader{
|
||||
object = nextEvent();
|
||||
}catch(XMLStreamException streamException){
|
||||
fLastEvent = null ;
|
||||
//xxx: what should be done in this case ?
|
||||
throw new NoSuchElementException();
|
||||
//don't swallow the cause
|
||||
NoSuchElementException e = new NoSuchElementException(streamException.getMessage());
|
||||
e.initCause(streamException.getCause());
|
||||
throw e;
|
||||
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user