summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 17:32:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-10-01 18:17:11 +0200
commit20bae560c05a3df6e7ce8d4b869ed00f951c1e59 (patch)
tree968607d7c4f33c26302bee6731858c1ed64aa622 /package
parentebeff35a0305683574373b75c7b0e5797749fe3e (diff)
throw more useful uno::Exception's
if we're going to throw the base class of the exception hierarchy, we can at least put a useful message in there to make the source a little bit easier to locate. Change-Id: I2f3106c99ba25125eacef8fa77e2f3a2c89f2566 Reviewed-on: https://gerrit.libreoffice.org/42968 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xfactory.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index 2747a5c0a8ed..bc956e0e362b 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -165,7 +165,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
else if ( !( aArguments[0] >>= xStream ) && !( aArguments[0] >>= xInputStream ) )
{
OSL_FAIL( "Wrong first argument!" );
- throw uno::Exception(); // TODO: Illegal argument
+ throw uno::Exception("wrong first arg", nullptr); // TODO: Illegal argument
}
// retrieve mediadescriptor and set storage properties
@@ -230,7 +230,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
else
{
OSL_FAIL( "Wrong third argument!" );
- throw uno::Exception(); // TODO: Illegal argument
+ throw uno::Exception("wrong 3rd arg", nullptr); // TODO: Illegal argument
}
}
@@ -240,7 +240,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
{
// if xInputStream is set the storage should be open from it
if ( nStorageMode & embed::ElementModes::WRITE )
- throw uno::Exception(); // TODO: access denied
+ throw uno::Exception("storagemode==write", nullptr); // TODO: access denied
uno::Reference< io::XSeekable > xSeekable( xInputStream, uno::UNO_QUERY );
if ( !xSeekable.is() )
@@ -258,9 +258,9 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
}
else if ( xStream.is() )
{
- if ( ( ( nStorageMode & embed::ElementModes::WRITE ) && !xStream->getOutputStream().is() )
- || !xStream->getInputStream().is() )
- throw uno::Exception(); // TODO: access denied
+ if ( ( ( nStorageMode & embed::ElementModes::WRITE ) && !xStream->getOutputStream().is() )
+ || !xStream->getInputStream().is() )
+ throw uno::Exception("access denied", nullptr); // TODO: access denied
uno::Reference< io::XSeekable > xSeekable( xStream, uno::UNO_QUERY );
if ( !xSeekable.is() )
@@ -277,7 +277,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
uno::UNO_QUERY );
}
- throw uno::Exception(); // general error during creation
+ throw uno::Exception("no input stream or regular stream", nullptr); // general error during creation
}
OUString SAL_CALL OStorageFactory::getImplementationName()