Kaydet (Commit) 27d02a34 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Improve debug messages

Some of those SAL_WARNs might actually better be SAL_INFOs; please change if
they hit too often.

Change-Id: I2a3b9bd485586b7878194f84bc734b54ce69bc06
üst 29c49b37
...@@ -67,14 +67,17 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque ...@@ -67,14 +67,17 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque
while( aIter != aEnd ) while( aIter != aEnd )
*pSequence++ = (*aIter++); *pSequence++ = (*aIter++);
} }
catch (SAXParseException& ) catch (SAXParseException& e)
{ {
SAL_WARN("package", "ignoring SAXParseException " + e.Message);
} }
catch (SAXException& ) catch (SAXException& e)
{ {
SAL_WARN("package", "ignoring SAXException " + e.Message);
} }
catch (IOException& ) catch (IOException& e)
{ {
SAL_WARN("package", "ignoring IOException " + e.Message);
} }
xParser->setDocumentHandler ( Reference < XDocumentHandler > () ); xParser->setDocumentHandler ( Reference < XDocumentHandler > () );
return aManifestSequence; return aManifestSequence;
......
...@@ -140,9 +140,10 @@ XUnbufferedStream::XUnbufferedStream( ...@@ -140,9 +140,10 @@ XUnbufferedStream::XUnbufferedStream(
try { try {
if ( mxZipSeek.is() ) if ( mxZipSeek.is() )
mnZipSize = mxZipSeek->getLength(); mnZipSize = mxZipSeek->getLength();
} catch( Exception& ) } catch( Exception& e )
{ {
// in case of problem the size will stay set to 0 // in case of problem the size will stay set to 0
SAL_WARN("package", "ignoring Exception " + e.Message);
} }
mnZipEnd = mnZipCurrent + mnZipSize; mnZipEnd = mnZipCurrent + mnZipSize;
......
...@@ -397,7 +397,10 @@ void ZipPackage::parseManifest() ...@@ -397,7 +397,10 @@ void ZipPackage::parseManifest()
// the mimetype stream should contain the information from manifest.xml // the mimetype stream should contain the information from manifest.xml
if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) ) if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) )
throw ZipIOException( throw ZipIOException(
OSL_LOG_PREFIX "mimetype conflicts with manifest.xml\n", (OSL_LOG_PREFIX
"mimetype conflicts with manifest.xml, \""
+ m_pRootFolder->GetMediaType() + "\" vs. \""
+ aPackageMediatype + "\""),
uno::Reference< uno::XInterface >() ); uno::Reference< uno::XInterface >() );
} }
...@@ -580,7 +583,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) ...@@ -580,7 +583,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
throw( Exception, RuntimeException ) throw( Exception, RuntimeException )
{ {
RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" ); RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" );
sal_Bool bBadZipFile = sal_False, bHaveZipFile = sal_True; sal_Bool bHaveZipFile = sal_True;
uno::Reference< XProgressHandler > xProgressHandler; uno::Reference< XProgressHandler > xProgressHandler;
beans::NamedValue aNamedValue; beans::NamedValue aNamedValue;
...@@ -750,18 +753,22 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) ...@@ -750,18 +753,22 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
} }
if ( bHaveZipFile ) if ( bHaveZipFile )
{ {
bool bBadZipFile = false;
OUString message;
try try
{ {
m_pZipFile = new ZipFile ( m_xContentStream, m_xContext, sal_True, m_bForceRecovery, xProgressHandler ); m_pZipFile = new ZipFile ( m_xContentStream, m_xContext, sal_True, m_bForceRecovery, xProgressHandler );
getZipFileContents(); getZipFileContents();
} }
catch ( IOException & ) catch ( IOException & e )
{ {
bBadZipFile = sal_True; bBadZipFile = true;
message = "IOException: " + e.Message;
} }
catch ( ZipException & ) catch ( ZipException & e )
{ {
bBadZipFile = sal_True; bBadZipFile = true;
message = "ZipException: " + e.Message;
} }
catch ( Exception & ) catch ( Exception & )
{ {
...@@ -775,7 +782,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) ...@@ -775,7 +782,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; } if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; }
throw com::sun::star::packages::zip::ZipIOException ( throw com::sun::star::packages::zip::ZipIOException (
OSL_LOG_PREFIX "Bad Zip File.", OSL_LOG_PREFIX "Bad Zip File, " + message,
static_cast < ::cppu::OWeakObject * > ( this ) ); static_cast < ::cppu::OWeakObject * > ( this ) );
} }
} }
......
...@@ -293,6 +293,7 @@ certain functionality. ...@@ -293,6 +293,7 @@ certain functionality.
@li @c helpcompiler @li @c helpcompiler
@li @c linguistic @li @c linguistic
@li @c oox @li @c oox
@li @c package
@li @c rsc @li @c rsc
@li @c sax @li @c sax
@li @c shell @li @c shell
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment