summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-29 16:21:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-04 15:18:00 +0200
commit2c05d758b2b62c9df413e2514fb3cd233d0f3ec7 (patch)
treee0a23d3da6fb17ae97d18957fc14f4a4a8de2d3f /comphelper
parenta3088b1e72ef17babe3d3664c610afd02cfe0891 (diff)
add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx14
-rw-r--r--comphelper/source/misc/documentinfo.cxx2
-rw-r--r--comphelper/source/misc/logging.cxx1
-rw-r--r--comphelper/source/misc/scopeguard.cxx2
-rw-r--r--comphelper/source/misc/threadpool.cxx2
-rw-r--r--comphelper/source/property/property.cxx15
6 files changed, 17 insertions, 19 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 530872c1a714..a3fce00e1c7b 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -358,7 +358,7 @@ uno::Reference<embed::XEmbeddedObject> EmbeddedObjectContainer::Get_Impl(
}
catch (uno::Exception const& e)
{
- SAL_WARN("comphelper.container", "EmbeddedObjectContainer::Get_Impl: exception caught: " << e.Message);
+ SAL_WARN("comphelper.container", "EmbeddedObjectContainer::Get_Impl: exception caught: " << e);
}
return xObj;
@@ -399,7 +399,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CreateEmbedde
}
catch (uno::Exception const& e)
{
- SAL_WARN("comphelper.container", "EmbeddedObjectContainer::CreateEmbeddedObject: exception caught: " << e.Message);
+ SAL_WARN("comphelper.container", "EmbeddedObjectContainer::CreateEmbeddedObject: exception caught: " << e);
}
return xObj;
@@ -511,7 +511,7 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
}
catch (uno::Exception const& e)
{
- SAL_WARN("comphelper.container", "EmbeddedObjectContainer::StoreEmbeddedObject: exception caught: " << e.Message);
+ SAL_WARN("comphelper.container", "EmbeddedObjectContainer::StoreEmbeddedObject: exception caught: " << e);
// TODO/LATER: better error recovery should keep storage intact
return false;
}
@@ -572,7 +572,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
catch (uno::Exception const& e)
{
// complete disaster!
- SAL_WARN("comphelper.container", "EmbeddedObjectContainer::InsertEmbeddedObject: exception caught: " << e.Message);
+ SAL_WARN("comphelper.container", "EmbeddedObjectContainer::InsertEmbeddedObject: exception caught: " << e);
return uno::Reference < embed::XEmbeddedObject >();
}
}
@@ -657,7 +657,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
catch (uno::Exception const& e)
{
SAL_WARN("comphelper.container", "EmbeddedObjectContainer::InsertEmbeddedLink: "
- "exception caught: " << e.Message);
+ "exception caught: " << e);
}
return xObj;
@@ -1126,7 +1126,7 @@ uno::Reference < io::XInputStream > EmbeddedObjectContainer::GetGraphicStream( c
catch (uno::Exception const& e)
{
SAL_INFO("comphelper.container",
- "EmbeddedObjectContainer::GetGraphicStream(): exception: " << e.Message);
+ "EmbeddedObjectContainer::GetGraphicStream(): " << e);
}
}
@@ -1348,7 +1348,7 @@ bool EmbeddedObjectContainer::StoreAsChildren(bool _bOasisFormat,bool _bCreateEm
{
// TODO/LATER: error handling
bResult = false;
- SAL_WARN("comphelper.container", "failed. Message: " << e.Message);
+ SAL_WARN("comphelper.container", "failed. Message: " << e);
}
// the old SO6 format does not store graphical replacements
diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx
index e309da6d74ed..b63450590554 100644
--- a/comphelper/source/misc/documentinfo.cxx
+++ b/comphelper/source/misc/documentinfo.cxx
@@ -150,7 +150,7 @@ namespace comphelper {
css::uno::Exception exception;
caught >>= exception;
SAL_WARN( "comphelper", "caught an exception!\ntype : " << caught.getValueTypeName()
- << "\nmessage: " << exception.Message
+ << "\nmessage: " << exception
<< "\nin function:\n" << OSL_THIS_FUNC);
}
diff --git a/comphelper/source/misc/logging.cxx b/comphelper/source/misc/logging.cxx
index 3744d9580727..e08d9d540a99 100644
--- a/comphelper/source/misc/logging.cxx
+++ b/comphelper/source/misc/logging.cxx
@@ -164,5 +164,4 @@ namespace comphelper
}
} // namespace comphelper
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx
index 2224c0993fff..d1f48f959fd2 100644
--- a/comphelper/source/misc/scopeguard.cxx
+++ b/comphelper/source/misc/scopeguard.cxx
@@ -32,7 +32,7 @@ ScopeGuard::~ScopeGuard()
m_func();
}
catch (css::uno::Exception & exc) {
- SAL_WARN( "comphelper", "UNO exception occurred: " << exc.Message );
+ SAL_WARN( "comphelper", "UNO exception occurred: " << exc );
}
catch (...) {
OSL_FAIL( "unknown exception occurred!" );
diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx
index 7368544a14b1..23e363213206 100644
--- a/comphelper/source/misc/threadpool.cxx
+++ b/comphelper/source/misc/threadpool.cxx
@@ -268,7 +268,7 @@ void ThreadTask::execAndDelete()
}
catch (const css::uno::Exception &e)
{
- SAL_WARN("comphelper", "exception in thread worker while calling doWork(): " << e.Message);
+ SAL_WARN("comphelper", "exception in thread worker while calling doWork(): " << e);
}
delete this;
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index 5e3fd29dc01b..f5e369808d2a 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/uno/genfunc.h>
-
+#include <rtl/ustrbuf.hxx>
#include <algorithm>
@@ -90,15 +90,15 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
catch (Exception&)
{
#if OSL_DEBUG_LEVEL > 0
- OStringBuffer aBuffer;
+ OUStringBuffer aBuffer;
aBuffer.append( "::comphelper::copyProperties: could not copy property '" );
- aBuffer.append( OString( pSourceProps->Name.getStr(), pSourceProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US ) );
+ aBuffer.append( pSourceProps->Name );
aBuffer.append( "' to the destination set (a '" );
Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY );
if ( xSI.is() )
{
- aBuffer.append( OUStringToOString( xSI->getImplementationName(), osl_getThreadTextEncoding() ) );
+ aBuffer.append( xSI->getImplementationName() );
}
else
{
@@ -108,20 +108,19 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
Any aException( ::cppu::getCaughtException() );
aBuffer.append( "Caught an exception of type '" );
- OUString sExceptionType( aException.getValueTypeName() );
- aBuffer.append( OString( sExceptionType.getStr(), sExceptionType.getLength(), RTL_TEXTENCODING_ASCII_US ) );
+ aBuffer.append( aException.getValueTypeName() );
aBuffer.append( "'" );
Exception aBaseException;
if ( ( aException >>= aBaseException ) && !aBaseException.Message.isEmpty() )
{
aBuffer.append( ", saying '" );
- aBuffer.append( OString( aBaseException.Message.getStr(), aBaseException.Message.getLength(), osl_getThreadTextEncoding() ) );
+ aBuffer.append( aBaseException.Message );
aBuffer.append( "'" );
}
aBuffer.append( "." );
- OSL_FAIL( aBuffer.getStr() );
+ SAL_WARN( "comphelper", aBuffer.makeStringAndClear() );
#endif
}
}