summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2017-08-21 22:47:47 +0300
committerMuhammet Kara <muhammet.kara@pardus.org.tr>2017-08-22 15:31:25 +0200
commitfc0b37ad4a80b7826b1a3b83f70ebb0e1107df7d (patch)
treeaa15988ff894f79797fb0a85216c812c0c5d0ef7
parent3b5f4f90e27d354d059b0fdb3a16bc21b005e774 (diff)
Add some exception messages to the removeSettings method
in UIConfigurationManager and ModuleUIConfigurationManager Change-Id: I82c5369dc43dc8ccd9be62acaf327a39f3b4d68f Reviewed-on: https://gerrit.libreoffice.org/41403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 3976f115ef539171e4b165c8d610ab7b49764f15) Reviewed-on: https://gerrit.libreoffice.org/41420 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx14
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx14
2 files changed, 20 insertions, 8 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 1bb4119e5387..4391212a11eb 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -1296,15 +1296,20 @@ void SAL_CALL ModuleUIConfigurationManager::removeSettings( const OUString& Reso
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
+ throw IllegalArgumentException( "The ResourceURL is not valid or "
+ "describes an unknown type. "
+ "ResourceURL: " + ResourceURL, nullptr, 0 );
else if ( m_bReadOnly )
- throw IllegalAccessException();
+ throw IllegalAccessException( "The configuration manager is read-only. "
+ "ResourceURL: " + ResourceURL, nullptr );
else
{
SolarMutexClearableGuard aGuard;
if ( m_bDisposed )
- throw DisposedException();
+ throw DisposedException( "The configuration manager has been disposed, "
+ "and can't uphold its method specification anymore. "
+ "ResourceURL: " + ResourceURL, nullptr );
UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
if ( pDataSettings )
@@ -1364,7 +1369,8 @@ void SAL_CALL ModuleUIConfigurationManager::removeSettings( const OUString& Reso
}
}
else
- throw NoSuchElementException();
+ throw NoSuchElementException( "The settings data cannot be found. "
+ "ResourceURL: " + ResourceURL, nullptr );
}
}
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 8419dac29b02..a7d90efa0ce1 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -1004,15 +1004,20 @@ void SAL_CALL UIConfigurationManager::removeSettings( const OUString& ResourceUR
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
- throw IllegalArgumentException();
+ throw IllegalArgumentException( "The ResourceURL is not valid or "
+ "describes an unknown type. "
+ "ResourceURL: " + ResourceURL, nullptr, 0 );
else if ( m_bReadOnly )
- throw IllegalAccessException();
+ throw IllegalAccessException( "The configuration manager is read-only. "
+ "ResourceURL: " + ResourceURL, nullptr );
else
{
SolarMutexClearableGuard aGuard;
if ( m_bDisposed )
- throw DisposedException();
+ throw DisposedException( "The configuration manager has been disposed, "
+ "and can't uphold its method specification anymore. "
+ "ResourceURL: " + ResourceURL, nullptr );
UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
if ( pDataSettings )
@@ -1051,7 +1056,8 @@ void SAL_CALL UIConfigurationManager::removeSettings( const OUString& ResourceUR
}
}
else
- throw NoSuchElementException();
+ throw NoSuchElementException( "The settings data cannot be found. "
+ "ResourceURL: " + ResourceURL, nullptr);
}
}