[Libreoffice-commits] core.git: basctl/source comphelper/source connectivity/source cui/source dbaccess/source dtrans/source embeddedobj/source framework/source mysqlc/source package/source reportdesign/source sfx2/source

Noel Grandin noel.grandin at collabora.co.uk
Sun Oct 1 16:17:37 UTC 2017


 basctl/source/basicide/moduldl2.cxx                             |    2 -
 comphelper/source/misc/mimeconfighelper.cxx                     |    2 -
 connectivity/source/commontools/CommonTools.cxx                 |    2 -
 connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx  |    2 -
 connectivity/source/drivers/ado/AResultSet.cxx                  |    2 -
 connectivity/source/drivers/ado/ATable.cxx                      |    2 -
 connectivity/source/drivers/dbase/DTable.cxx                    |    2 -
 connectivity/source/drivers/jdbc/ResultSet.cxx                  |    2 -
 connectivity/source/drivers/macab/MacabResultSet.cxx            |    2 -
 connectivity/source/drivers/mork/MResultSet.cxx                 |    2 -
 connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx |    2 -
 connectivity/source/drivers/odbc/OResultSet.cxx                 |    2 -
 cui/source/options/optaboutconfig.cxx                           |   12 ++++----
 dbaccess/source/core/api/RowSet.cxx                             |    2 -
 dtrans/source/win32/dnd/target.cxx                              |    2 -
 embeddedobj/source/commonembedding/visobj.cxx                   |    6 ++--
 framework/source/services/autorecovery.cxx                      |    4 +-
 mysqlc/source/mysqlc_resultset.cxx                              |    2 -
 package/source/xstor/xfactory.cxx                               |   14 +++++-----
 reportdesign/source/core/sdr/RptModel.cxx                       |   12 ++++----
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx     |    4 +-
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx     |    2 -
 sfx2/source/doc/doctemplates.cxx                                |    2 -
 sfx2/source/doc/objserv.cxx                                     |    2 -
 sfx2/source/doc/sfxbasemodel.cxx                                |    6 ++--
 25 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit 20bae560c05a3df6e7ce8d4b869ed00f951c1e59
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Sat Sep 30 17:32:50 2017 +0200

    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 at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 5bd4910b8dc0..4c2e88dfe6c5 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -1517,7 +1517,7 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
                 OUString aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
                 OUString sModuleCode;
                 if ( !rDocument.createModule( aLibName, aModName, true, sModuleCode ) )
-                    throw Exception();
+                    throw Exception("could not create module " + aModName, nullptr);
 
                 SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE );
                 if (SfxDispatcher* pDispatcher = GetDispatcher())
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index a347072dec66..0d4d6fecb778 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -773,7 +773,7 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
                 if ( !( nFlags & SfxFilterFlags::IMPORT ) )
                 {
                     OSL_FAIL( "This is no import filter!" );
-                    throw uno::Exception();
+                    throw uno::Exception("this is no import filter", nullptr);
                 }
 
                 if ( nFlags & SfxFilterFlags::EXPORT )
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 2afca36d0604..3bfef6fd3d03 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -134,7 +134,7 @@ namespace connectivity
             Any uaJVM = xVM->getJavaVM( processID );
             sal_Int64 nTemp;
             if (!(uaJVM >>= nTemp)) {
-                throw Exception(); // -5
+                throw Exception("cannot get result for getJavaVM", nullptr); // -5
             }
             aRet = reinterpret_cast<jvmaccess::VirtualMachine *>(
                 static_cast<sal_IntPtr>(nTemp));
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index df4d7e274681..fa7657095050 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -747,7 +747,7 @@ void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast(
         case PROPERTY_ID_RESULTSETTYPE:
         case PROPERTY_ID_FETCHDIRECTION:
         case PROPERTY_ID_FETCHSIZE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
         default:
             OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!");
     }
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index 1e2c5b76e44f..17c6f25810c4 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -1097,7 +1097,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
         case PROPERTY_ID_CURSORNAME:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
             break;
         case PROPERTY_ID_FETCHDIRECTION:
             setFetchDirection(getINT32(rValue));
diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx
index 567f660bd72e..dd84f1f67753 100644
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ b/connectivity/source/drivers/ado/ATable.cxx
@@ -215,7 +215,7 @@ void OAdoTable::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rV
                 break;
 
             default:
-                                throw Exception();
+                throw Exception("unknown prop " + OUString::number(nHandle), nullptr);
         }
     }
     OTable_TYPEDEF::setFastPropertyValue_NoBroadcast(nHandle,rValue);
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index a5574288a248..48e03e90f9b8 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2308,7 +2308,7 @@ namespace
             Sequence< Any > aValues;
             aContent.executeCommand( "setPropertyValues",makeAny(aProps) ) >>= aValues;
             if(aValues.getLength() && aValues[0].hasValue())
-                throw Exception();
+                throw Exception("setPropertyValues returned non-zero", nullptr);
         }
         catch(const Exception&)
         {
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 94af450a1c2e..d0db5f52078d 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -933,7 +933,7 @@ void java_sql_ResultSet::setFastPropertyValue_NoBroadcast(
         case PROPERTY_ID_CURSORNAME:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw css::uno::Exception();
+            throw css::uno::Exception("cannot set prop " + OUString::number(nHandle), nullptr);
         case PROPERTY_ID_FETCHDIRECTION:
             setFetchDirection(comphelper::getINT32(rValue));
             break;
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index eaf74c2776b0..71d4dbfb05a8 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -1040,7 +1040,7 @@ void MacabResultSet::setFastPropertyValue_NoBroadcast(
         case PROPERTY_ID_CURSORNAME:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
             break;
         case PROPERTY_ID_FETCHDIRECTION:
             break;
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index c510fff3255f..c461d4e09a54 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -579,7 +579,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast(
         case PROPERTY_ID_ISBOOKMARKABLE:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
         case PROPERTY_ID_FETCHDIRECTION:
             break;
         case PROPERTY_ID_FETCHSIZE:
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index a5ee72690dde..370b26f60abb 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -758,7 +758,7 @@ void ODatabaseMetaDataResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHa
         case PROPERTY_ID_RESULTSETTYPE:
         case PROPERTY_ID_FETCHDIRECTION:
         case PROPERTY_ID_FETCHSIZE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
         default:
             OSL_FAIL("setFastPropertyValue_NoBroadcast: Illegal handle value!");
     }
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index b9089952dd6a..51c2e88ae2cf 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -1456,7 +1456,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast(
         case PROPERTY_ID_CURSORNAME:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw Exception();
+            throw Exception("cannot set prop " + OUString::number(nHandle), nullptr);
         case PROPERTY_ID_FETCHDIRECTION:
             setFetchDirection(getINT32(rValue));
             break;
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index a006e71639ee..85b4a8631487 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -650,7 +650,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
 
                         //if the value is 0 and length is not 1, there is something wrong
                         if( ( nNumb==0 && sNewValue.getLength()!=1 ) || nNumb >= SAL_MAX_INT16 || nNumb <= SAL_MIN_INT16)
-                            throw uno::Exception();
+                            throw uno::Exception("out of range short", nullptr);
                         nShort = (sal_Int16) nNumb;
                         pProperty->Value <<= nShort;
                     }
@@ -658,28 +658,28 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
                     {
                         sal_Int32 nLong = sNewValue.toInt32();
                         if( ( nLong==0 && sNewValue.getLength()!=1 ) || nLong >= SAL_MAX_INT32 || nLong <= SAL_MIN_INT32)
-                            throw uno::Exception();
+                            throw uno::Exception("out of range long", nullptr);
                         pProperty->Value <<= nLong;
                     }
                     else if( sPropertyType == "hyper")
                     {
                         sal_Int64 nHyper = sNewValue.toInt64();
                         if( ( nHyper==0 && sNewValue.getLength()!=1 ) || nHyper >= SAL_MAX_INT32 || nHyper <= SAL_MIN_INT32)
-                            throw uno::Exception();
+                            throw uno::Exception("out of range hyper", nullptr);
                         pProperty->Value <<= nHyper;
                     }
                     else if( sPropertyType == "double")
                     {
                         double nDoub = sNewValue.toDouble();
                         if( ( nDoub ==0 && sNewValue.getLength()!=1 ) || nDoub >= SAL_MAX_INT32 || nDoub <= SAL_MIN_INT32)
-                            throw uno::Exception();
+                            throw uno::Exception("out of range double", nullptr);
                         pProperty->Value <<= nDoub;
                     }
                     else if( sPropertyType == "float")
                     {
                         float nFloat = sNewValue.toFloat();
                         if( ( nFloat ==0 && sNewValue.getLength()!=1 ) || nFloat >= SAL_MAX_INT32 || nFloat <= SAL_MIN_INT32)
-                            throw uno::Exception();
+                            throw uno::Exception("out of range float", nullptr);
                          pProperty->Value <<= nFloat;
                     }
                     else if( sPropertyType == "string" )
@@ -752,7 +752,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
                         pProperty->Value <<= comphelper::containerToSequence( commaStringToSequence( sNewValue ));
                     }
                     else //unknown
-                        throw uno::Exception();
+                        throw uno::Exception("unknown property type " + sPropertyType, nullptr);
 
                     sDialogValue = sNewValue;
                 }
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 063c37318e5a..0a2d91000648 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -289,7 +289,7 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const
             break;
         case PROPERTY_ID_FETCHDIRECTION:
             if( m_nResultSetType == ResultSetType::FORWARD_ONLY)
-                throw Exception();
+                throw Exception("resultsettype is FORWARD_ONLY", nullptr);
             SAL_FALLTHROUGH;
         default:
             OPropertyStateContainer::setFastPropertyValue_NoBroadcast(nHandle,rValue);
diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx
index ab3c554ea5bc..494119c11f57 100644
--- a/dtrans/source/win32/dnd/target.cxx
+++ b/dtrans/source/win32/dnd/target.cxx
@@ -180,7 +180,7 @@ void SAL_CALL DropTarget::initialize( const Sequence< Any >& aArguments )
             }
         }
         else
-            throw Exception();
+            throw Exception("OleInitialize failed with " + OUString::number(hr), nullptr);
 
     }
 }
diff --git a/embeddedobj/source/commonembedding/visobj.cxx b/embeddedobj/source/commonembedding/visobj.cxx
index 431f871fe492..28df7ed0f583 100644
--- a/embeddedobj/source/commonembedding/visobj.cxx
+++ b/embeddedobj/source/commonembedding/visobj.cxx
@@ -63,7 +63,7 @@ void SAL_CALL OCommonEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const
         changeState( embed::EmbedStates::LOADED );
 
     if ( !bSuccess )
-        throw uno::Exception(); // TODO:
+        throw uno::Exception("SetExtent failed", nullptr); // TODO:
 }
 
 awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
@@ -97,7 +97,7 @@ awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
         changeState( embed::EmbedStates::LOADED );
 
     if ( !bSuccess )
-        throw uno::Exception(); // TODO:
+        throw uno::Exception("GetExtent failed", nullptr); // TODO:
 
     return aResult;
 }
@@ -136,7 +136,7 @@ sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapUnit( sal_Int64 nAspect )
         changeState( embed::EmbedStates::LOADED );
 
     if ( nResult < 0  )
-        throw uno::Exception(); // TODO:
+        throw uno::Exception("result " + OUString::number(nResult), nullptr); // TODO:
 
     return nResult;
 }
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 8273e53542bf..80ab99ba0996 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2064,7 +2064,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn
             batch->commit();
 
 #ifdef TRIGGER_FULL_DISC_CHECK
-            throw css::uno::Exception();
+            throw css::uno::Exception("trigger full disk check");
 #else  // TRIGGER_FULL_DISC_CHECK
             nRetry = 0;
 #endif // TRIGGER_FULL_DISC_CHECK
@@ -3078,7 +3078,7 @@ void AutoRecovery::implts_saveOneDoc(const OUString&
             xDocRecover->storeToRecoveryFile( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() );
 
 #ifdef TRIGGER_FULL_DISC_CHECK
-            throw css::uno::Exception();
+            throw css::uno::Exception("trigger full disk check");
 #else  // TRIGGER_FULL_DISC_CHECK
 
             bError = false;
diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx
index f66723c65966..7911bba8fd12 100644
--- a/mysqlc/source/mysqlc_resultset.cxx
+++ b/mysqlc/source/mysqlc_resultset.cxx
@@ -988,7 +988,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any&
         case PROPERTY_ID_CURSORNAME:
         case PROPERTY_ID_RESULTSETCONCURRENCY:
         case PROPERTY_ID_RESULTSETTYPE:
-            throw Exception();
+            throw Exception("cannot set prop " + rtl::OUString::number(nHandle), nullptr);
         case PROPERTY_ID_FETCHDIRECTION:
             break;
         case PROPERTY_ID_FETCHSIZE:
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()
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 60cf31e4d2fe..6e9371015c5f 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -148,38 +148,38 @@ uno::Reference< uno::XInterface > OReportModel::createShape(const OUString& aSer
             uno::Reference<report::XFormattedField> xProp = new OFormattedField(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape);
             xRet = xProp;
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
             xProp->setPropertyValue( PROPERTY_FORMATSSUPPLIER, uno::makeAny(uno::Reference< util::XNumberFormatsSupplier >(*m_pReportDefinition,uno::UNO_QUERY)) );
         }
         else if ( aServiceSpecifier == SERVICE_FIXEDTEXT)
         {
             xRet = static_cast<cppu::OWeakObject*>(new OFixedText(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
         }
         else if ( aServiceSpecifier == SERVICE_FIXEDLINE)
         {
             xRet = static_cast<cppu::OWeakObject*>(new OFixedLine(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,nOrientation));
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
         }
         else if ( aServiceSpecifier == SERVICE_IMAGECONTROL )
         {
             xRet = static_cast<cppu::OWeakObject*>(new OImageControl(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
         }
         else if ( aServiceSpecifier == SERVICE_REPORTDEFINITION )
         {
             xRet = static_cast<cppu::OWeakObject*>(new OReportDefinition(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
         }
         else if ( _rShape.is() )
         {
             xRet = static_cast<cppu::OWeakObject*>(new OShape(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,aServiceSpecifier));
             if ( _rShape.is() )
-                throw uno::Exception();
+                throw uno::Exception("no shape", nullptr);
         }
     }
     return xRet;
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index b359f8f987d6..f68dc4d9e554 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -297,11 +297,11 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >
 
     OSL_ENSURE(m_xDelegatee.is(),"No document handler available!");
     if ( !m_xDelegatee.is() || !m_xModel.is() )
-        throw uno::Exception();
+        throw uno::Exception("no delegatee and no model", nullptr);
 
     m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY_THROW);
     if ( !m_xDatabaseDataProvider->getActiveConnection().is() )
-        throw uno::Exception();
+        throw uno::Exception("no active connection", nullptr);
 
     uno::Reference< reflection::XProxyFactory > xProxyFactory = reflection::ProxyFactory::create( m_xContext );
     m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 3aedaaaa8272..315883a300a6 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -347,7 +347,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >
 
     OSL_ENSURE(m_xDelegatee.is(),"No document handler available!");
     if ( !m_xDelegatee.is() || !m_xModel.is() )
-        throw uno::Exception();
+        throw uno::Exception("no delegatee and no model", nullptr);
 
     m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY);
     if ( !m_xDatabaseDataProvider.is() )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index d0e5cb929620..7181a5db9fcb 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1653,7 +1653,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
             while ( xResultSet->next() )
             {
                 if ( !::utl::UCBContentHelper::IsSubPath( aGroupTargetURL, xRow->getString( 1 ) ) )
-                    throw uno::Exception();
+                    throw uno::Exception("not sub path", nullptr);
             }
 
             bCanBeRenamed = true;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 6dc7fc317dc2..18ec45205a50 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -618,7 +618,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
                 bool bForceSaveAs = nId == SID_SAVEDOC && IsReadOnlyMedium();
                 const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( bForceSaveAs ? SID_SAVEASDOC : nId );
                 if ( !pSlot )
-                    throw uno::Exception();
+                    throw uno::Exception("no slot", nullptr);
 
                 SfxStoringHelper aHelper;
 
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ce5f43c9bf9d..65427284b637 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3486,7 +3486,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
     SfxModelGuard aGuard( *this );
 
     if ( !m_pData->m_pObjectShell.is() )
-        throw Exception(); // TODO: error handling
+        throw Exception("no object shell", nullptr); // TODO: error handling
 
     SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false );
     if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
@@ -3513,7 +3513,7 @@ awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 /*nAspect*/ )
     SfxModelGuard aGuard( *this );
 
     if ( !m_pData->m_pObjectShell.is() )
-        throw Exception(); // TODO: error handling
+        throw Exception("no object shell", nullptr); // TODO: error handling
 
     tools::Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT );
 
@@ -3526,7 +3526,7 @@ sal_Int32 SAL_CALL SfxBaseModel::getMapUnit( sal_Int64 /*nAspect*/ )
     SfxModelGuard aGuard( *this );
 
     if ( !m_pData->m_pObjectShell.is() )
-        throw Exception(); // TODO: error handling
+        throw Exception("no object shell", nullptr); // TODO: error handling
 
     return VCLUnoHelper::VCL2UnoEmbedMapUnit( m_pData->m_pObjectShell->GetMapUnit() );
 }


More information about the Libreoffice-commits mailing list