summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-20 11:32:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-22 06:46:43 +0100
commitf61f00862380fed99a09a11d67fef5d8efbce368 (patch)
treea03527b6780c835aa1124b7179c4df53fcb00589
parent1c58b2a437a7083c40c93a1c2e12a6fe6b6fd637 (diff)
log exceptions when parsing
to make debugging easier Change-Id: Ia19384a925a2bb437fa5d961e6c3d44eebe0c6b6 Reviewed-on: https://gerrit.libreoffice.org/83345 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--editeng/source/misc/svxacorr.cxx1
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx28
2 files changed, 9 insertions, 20 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 24ff88d8e725..48d6676b26f2 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2181,6 +2181,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
}
catch ( const uno::Exception& )
{
+ TOOLS_WARN_EXCEPTION("editeng", "when loading " << sShareAutoCorrFile);
}
// Set time stamp
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 843e545a39a0..f4880417e929 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -23,6 +23,7 @@
#include <svl/macitem.hxx>
#include <svtools/unoevent.hxx>
#include <sfx2/docfile.hxx>
+#include <tools/diagnose_ex.h>
#include <unotools/streamwrap.hxx>
#include <comphelper/fileformat.h>
#include <comphelper/processfactory.hxx>
@@ -400,11 +401,12 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort,
void SwXMLTextBlocks::ReadInfo()
{
- try
- {
const OUString sDocName( XMLN_BLOCKLIST );
- if ( xBlkRoot.is() && xBlkRoot->hasByName( sDocName ) && xBlkRoot->isStreamElement( sDocName ) )
+ try
{
+ if ( !xBlkRoot.is() || !xBlkRoot->hasByName( sDocName ) || !xBlkRoot->isStreamElement( sDocName ) )
+ return;
+
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
@@ -425,26 +427,12 @@ void SwXMLTextBlocks::ReadInfo()
xParser->setTokenHandler( xTokenHandler );
// parse
- try
- {
- xParser->parseStream( aParserInput );
- }
- catch( xml::sax::SAXParseException& )
- {
- // re throw ?
- }
- catch( xml::sax::SAXException& )
- {
- // re throw ?
- }
- catch( io::IOException& )
- {
- // re throw ?
- }
- }
+ xParser->parseStream( aParserInput );
}
catch ( uno::Exception& )
{
+ TOOLS_WARN_EXCEPTION("sw", "when loading " << sDocName);
+ // re throw ?
}
}
void SwXMLTextBlocks::WriteInfo()