diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-15 10:44:08 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-08-05 21:06:51 -0400 |
commit | 90258c5001c862cfd03f829d4aab2feac240eef6 (patch) | |
tree | 0abc1781eeca085a7eae5b9aa0cf0a41bcd8f6e8 /package | |
parent | 985223a77d078412e5caacfc2fc06da65d821da4 (diff) |
pretty up logging of exceptions
Add exceptionToString() and getCaughtExceptionAsString() methods in
tools.
Use the new methods in DbgUnhandledException()
Add special-case case code for most of the exceptions that contain extra
fields, so all of the relevant data ends up in the log
Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece
Reviewed-on: https://gerrit.libreoffice.org/67857
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r-- | package/Library_xstor.mk | 1 | ||||
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 17 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 241 |
3 files changed, 131 insertions, 128 deletions
diff --git a/package/Library_xstor.mk b/package/Library_xstor.mk index 03e7f5c90db9..b6498b8c128f 100644 --- a/package/Library_xstor.mk +++ b/package/Library_xstor.mk @@ -26,6 +26,7 @@ $(eval $(call gb_Library_use_libraries,xstor,\ cppuhelper \ sal \ salhelper \ + tl \ )) $(eval $(call gb_Library_add_exception_objects,xstor,\ diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 8fe6446b50db..89700fe8ec72 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -48,6 +48,7 @@ #include <rtl/digest.h> #include <rtl/instance.hxx> +#include <tools/diagnose_ex.h> #include <PackageConstants.hxx> @@ -2361,10 +2362,10 @@ void SAL_CALL OWriteStream::dispose() m_pImpl->Revert(); } } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); throw lang::WrappedTargetRuntimeException("Can not commit/revert the storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -2490,10 +2491,10 @@ sal_Bool SAL_CALL OWriteStream::hasEncryptionData() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); throw lang::WrappedTargetRuntimeException( "Problems on hasEncryptionData!", static_cast< ::cppu::OWeakObject* >( this ), aCaught ); @@ -3170,10 +3171,10 @@ void SAL_CALL OWriteStream::commit() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); throw embed::StorageWrappedTargetException( "Problems on commit!", static_cast< ::cppu::OWeakObject* >( this ), aCaught ); @@ -3225,10 +3226,10 @@ void SAL_CALL OWriteStream::revert() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); throw embed::StorageWrappedTargetException( "Problems on revert!", static_cast< ::cppu::OWeakObject* >( this ), aCaught ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index f29ecfd3ea0a..ac0017f9b974 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -55,6 +55,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/ofopxmlhelper.hxx> +#include <tools/diagnose_ex.h> #include "xstorage.hxx" #include "owriteablestream.hxx" @@ -2241,11 +2242,11 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy storage!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2318,11 +2319,11 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException(THROW_WHERE "Can't open stream element!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2465,11 +2466,11 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open storage!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2532,11 +2533,11 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUStr SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2590,11 +2591,11 @@ void SAL_CALL OStorage::copyLastCommitTo( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit version!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2669,11 +2670,11 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit element version!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2722,11 +2723,11 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can't detect whether it is a stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2780,11 +2781,11 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "can't detect whether it is a storage", uno::Reference< io::XInputStream >(), aCaught ); @@ -2857,11 +2858,11 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't remove element!", uno::Reference< io::XInputStream >(), aCaught ); @@ -2942,11 +2943,11 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't rename element!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3027,11 +3028,11 @@ void SAL_CALL OStorage::copyElementTo( const OUString& aElementName, SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3115,11 +3116,11 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't move element!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3199,11 +3200,11 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open encrypted stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3274,11 +3275,11 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone encrypted stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3364,11 +3365,11 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get plain raw stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3464,11 +3465,11 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get raw stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3543,11 +3544,11 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName, SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert raw stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -3594,11 +3595,11 @@ void SAL_CALL OStorage::commit() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on commit!", static_cast< ::cppu::OWeakObject* >( this ), aCaught ); @@ -3658,11 +3659,11 @@ void SAL_CALL OStorage::revert() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on revert!", static_cast< ::cppu::OWeakObject* >( this ), aCaught ); @@ -3822,11 +3823,11 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetException( THROW_WHERE "Can not open storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -3854,11 +3855,11 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -3891,11 +3892,11 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -3937,11 +3938,11 @@ sal_Bool SAL_CALL OStorage::hasElements() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -3968,11 +3969,11 @@ void SAL_CALL OStorage::dispose() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4040,11 +4041,11 @@ void SAL_CALL OStorage::removeEncryption() SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4108,11 +4109,11 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4173,11 +4174,11 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException); throw; } - catch ( const uno::Exception& aException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4194,11 +4195,11 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException); throw; } - catch( const uno::Exception& aException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4233,11 +4234,11 @@ void SAL_CALL OStorage::setGpgProperties( const uno::Sequence< uno::Sequence< be SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message); throw; } - catch ( const uno::Exception& aException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException.Message); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4254,11 +4255,11 @@ void SAL_CALL OStorage::setGpgProperties( const uno::Sequence< uno::Sequence< be SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message); throw; } - catch( const uno::Exception& aException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException.Message); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4291,11 +4292,11 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException); throw; } - catch ( const uno::Exception& aException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4311,11 +4312,11 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException); throw; } - catch( const uno::Exception& aException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << aException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -4462,11 +4463,11 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetException( "Can't read contents!", static_cast< OWeakObject* >( this ), @@ -4520,11 +4521,11 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch ( const uno::Exception& rException ) + catch ( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw lang::WrappedTargetException( THROW_WHERE "Can not open package!", static_cast< OWeakObject* >( this ), aCaught ); @@ -5032,11 +5033,11 @@ void SAL_CALL OStorage::insertStreamElementDirect( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert stream directly!", uno::Reference< io::XInputStream >(), aCaught ); @@ -5115,11 +5116,11 @@ void SAL_CALL OStorage::copyElementDirectlyTo( SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element directly!", uno::Reference< io::XInputStream >(), aCaught ); @@ -5171,11 +5172,11 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't write and attach to stream!", uno::Reference< io::XInputStream >(), aCaught ); @@ -5241,11 +5242,11 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL, SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't attach to URL!", uno::Reference< io::XInputStream >(), aCaught ); @@ -5327,11 +5328,11 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get element property!", uno::Reference< io::XInputStream >(), aCaught ); @@ -5396,11 +5397,11 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException); throw; } - catch( const uno::Exception& rException ) + catch( const uno::Exception& ) { - SAL_INFO("package.xstor", "Rethrow: " << rException); - uno::Any aCaught( ::cppu::getCaughtException() ); + SAL_INFO("package.xstor", "Rethrow: " << exceptionToString(aCaught)); + throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy stream data!", uno::Reference< io::XInputStream >(), aCaught ); |