summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-07-11 20:49:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-13 20:21:03 +0000
commit7cd2871b594ff49267b1fe8c3100e1ca717928c6 (patch)
tree41a07dc40f62289b092182c35facee1a3a860e84
parent7707f1cf74115e659794ffe6214529c24aee0340 (diff)
fdo#81214 - tolerate exceptions thrown inside XFastParser callbacks.
Not an ideal solution; ideally we should not throw the exceptions, and stop the parser as soon as something bad like this happens; but hopefully exception throwing is reasonable exceptional. Change-Id: If619592533b2929c671e2b03eb8a83480bd92c54 Reviewed-on: https://gerrit.libreoffice.org/10242 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sax/source/fastparser/fastparser.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 17e0213e8845..d3103d153dc5 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -607,12 +607,11 @@ void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumen
// the consuming thread.
void Entity::saveException( const Exception &e )
{
- // only store the first exception
- if( !maSavedException.hasValue() )
- {
- maSavedException <<= e;
- XML_StopParser( mpParser, /* resumable? */ XML_FALSE );
- }
+ // fdo#81214 - allow the parser to run on after an exception,
+ // unexpectedly some 'startElements' produce an UNO_QUERY_THROW
+ // for XComponent; and yet expect to continue parsing.
+ SAL_WARN("sax", "Unexpected exception from XML parser " << e.Message);
+ maSavedException <<= e;
}
} // namespace