diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2002-05-13 07:06:58 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2002-05-13 07:06:58 +0000 |
commit | 6613dcdb27d9470504b2036b131b9ab4441d9947 (patch) | |
tree | 594c54b603c9e20ab18a881a277f1d0f1d87d66a /package | |
parent | cb432d39e210ddb5f472e7633bb47b75461a44c7 (diff) |
#99253# throw an exception in case of an error on commit
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 8622accbf76d..4bba7613207c 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackage.cxx,v $ * - * $Revision: 1.81 $ + * $Revision: 1.82 $ * - * last change: $Author: mav $ $Date: 2002-04-29 15:04:19 $ + * last change: $Author: mav $ $Date: 2002-05-13 08:06:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -744,9 +744,13 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) aZipOut.write( aType, 0, nBufferLength ); aZipOut.closeEntry(); } - catch (::com::sun::star::io::IOException & ) + catch ( ::com::sun::star::io::IOException & r ) { VOS_ENSURE( 0, "Error adding mimetype to the ZipOutputStream" ); + throw WrappedTargetException( + OUString( RTL_CONSTASCII_USTRINGPARAM ( "Error adding mimetype to the ZipOutputStream!" ) ), + static_cast < OWeakObject * > ( this ), + makeAny( r ) ); } } @@ -864,20 +868,37 @@ sal_Bool ZipPackage::writeFileIsTemp() aZipOut.write( pBuffer->getSequence(), 0, nBufferLength ); aZipOut.closeEntry(); } - catch (::com::sun::star::io::IOException & ) + catch (::com::sun::star::io::IOException & r ) { VOS_ENSURE( 0, "Error adding META-INF/manifest.xml to the ZipOutputStream" ); + throw WrappedTargetException( + OUString( RTL_CONSTASCII_USTRINGPARAM ( "Error adding META-INF/manifest.xml to the ZipOutputStream!" ) ), + static_cast < OWeakObject * > ( this ), + makeAny( r ) ); + } } else + { VOS_ENSURE ( 0, "Couldn't get a ManifestWriter!" ); + IOException aException; + throw WrappedTargetException( + OUString( RTL_CONSTASCII_USTRINGPARAM ( "Couldn't get a ManifestWriter!" ) ), + static_cast < OWeakObject * > ( this ), + makeAny( aException ) ); + } + try { aZipOut.finish(); } - catch (::com::sun::star::io::IOException & ) + catch (::com::sun::star::io::IOException & r ) { VOS_ENSURE( 0, "Error writing ZIP file to disk" ); + throw WrappedTargetException( + OUString( RTL_CONSTASCII_USTRINGPARAM ( "Error writing ZIP file to disk!" ) ), + static_cast < OWeakObject * > ( this ), + makeAny( r ) ); } if ( eMode == e_IMode_XStream ) |