summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-07-11 20:49:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-15 11:01:02 +0000
commit779c4cf10a9fd7e6d3c165d709531946cf68939d (patch)
treef78d0c9a1e0919a1c243bb594abc858ad3828b58
parent874859a8feb8cfadd7f491ebae99ff8aa5fd43c7 (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/10289 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit b8d8ec78c3e242d94963beef5aff6335f047ef59) Reviewed-on: https://gerrit.libreoffice.org/10290 Reviewed-by: David Tardon <dtardon@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 e10ce3fffb38..2ae9abfad717 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -627,12 +627,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