do *not* silently ignore errors when saving libraries

In case of error, it leads to *data* *loss*.

Change-Id: I80d806ef10a3364174eced3095ebf1ea217d75b4
This commit is contained in:
Lionel Elie Mamane
2013-08-02 23:35:20 +02:00
parent fc9080a0c6
commit a43a18edb0

View File

@@ -1924,7 +1924,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
<< rLib.aName << "\". Exception: " << rLib.aName << "\". Exception: "
<< comphelper::anyToString(aError)); << comphelper::anyToString(aError));
#endif #endif
return; throw;
} }
} }
@@ -1954,6 +1954,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
{ {
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
// TODO: error handling // TODO: error handling
throw;
} }
} }
} }
@@ -2033,6 +2034,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
catch( const Exception& ) catch( const Exception& )
{ {
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
throw;
} }
} }
@@ -2384,7 +2386,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
<< "\". Exception: " << "\". Exception: "
<< comphelper::anyToString(aError)); << comphelper::anyToString(aError));
#endif #endif
return; throw;
} }
} }
@@ -2418,13 +2420,8 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
aFile = aElementName; aFile = aElementName;
aFile += "."; aFile += ".";
aFile += maLibElementFileExtension; aFile += maLibElementFileExtension;
try
{
xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ ); xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ );
} }
catch(const uno::Exception& )
{}
}
if ( xElementStream.is() ) if ( xElementStream.is() )
{ {
@@ -2436,7 +2433,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
"basic", "basic",
"couldn't open library element stream - attempted to" "couldn't open library element stream - attempted to"
" open library \"" << Name << '"'); " open library \"" << Name << '"');
return; throw RuntimeException("couln't open library element stream", *this);
} }
} }
else else