diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2017-08-21 22:47:47 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-22 13:14:33 +0200 |
commit | 3976f115ef539171e4b165c8d610ab7b49764f15 (patch) | |
tree | 7fe8a19e94d09a74c5a99711873b0ec89179d06e /framework | |
parent | ebc11ae0b132eefd3b1b1a837a8d0ad3ba73b460 (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>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 14 | ||||
-rw-r--r-- | framework/source/uiconfiguration/uiconfigurationmanager.cxx | 14 |
2 files changed, 20 insertions, 8 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 19f6ce0af138..aa94300e6154 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -1295,15 +1295,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 ) @@ -1363,7 +1368,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 98a3a7faa729..17a585b210a3 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -1005,15 +1005,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 ) @@ -1052,7 +1057,8 @@ void SAL_CALL UIConfigurationManager::removeSettings( const OUString& ResourceUR } } else - throw NoSuchElementException(); + throw NoSuchElementException( "The settings data cannot be found. " + "ResourceURL: " + ResourceURL, nullptr); } } |