From 44f74a0c2bee7e93bb94e135304f5078280dd760 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Feb 2013 19:28:42 +0100 Subject: EmbeddedObjectContainer: log some exceptions Change-Id: I7356dfedc6121876641ef0e5f41d50db725980d4 --- .../source/container/embeddedobjectcontainer.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 60a4126a377e..8f449b5caa6a 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -380,8 +380,10 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::Get_Impl( con // insert object into my list AddEmbeddedObject( xObj, rName ); } - catch (const uno::Exception&) + catch (uno::Exception const& e) { + SAL_WARN("comphelper", "EmbeddedObjectContainer::Get_Impl: " + "exception caught: " << e.Message); } return xObj; @@ -416,8 +418,10 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != embed::EmbedStates::LOADED, "A freshly create object should be running always!\n" ); } - catch (const uno::Exception&) + catch (uno::Exception const& e) { + SAL_WARN("comphelper", "EmbeddedObjectContainer::CreateEmbeddedObject: " + "exception caught: " << e.Message); } return xObj; @@ -523,8 +527,10 @@ sal_Bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < em } } } - catch (const uno::Exception&) + catch (uno::Exception const& e) { + SAL_WARN("comphelper", "EmbeddedObjectContainer::StoreEmbeddedObject: " + "exception caught: " << e.Message); // TODO/LATER: better error recovery should keep storage intact return sal_False; } @@ -585,9 +591,12 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde xProps->setPropertyValue( OUString( "MediaType" ), uno::makeAny( OUString( "application/vnd.sun.star.oleobject" ) ) ); } - catch (const uno::Exception&) + catch (uno::Exception const& e) { // complete disaster! + SAL_WARN("comphelper", + "EmbeddedObjectContainer::InsertEmbeddedObject: " + "exception caught: " << e.Message); return uno::Reference < embed::XEmbeddedObject >(); } } @@ -669,8 +678,10 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde AddEmbeddedObject( xObj, rNewName ); } - catch (const uno::Exception&) + catch (uno::Exception const& e) { + SAL_WARN("comphelper", "EmbeddedObjectContainer::InsertEmbeddedLink: " + "exception caught: " << e.Message); } return xObj; -- cgit