From bbd34216dca07bb37b9188147c42e64bbf875d54 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Jan 2017 11:22:54 +0200 Subject: improve exception messages in stoc Change-Id: I43716332ab916e5ec7b8ab7a4d14895d060a9bd4 Reviewed-on: https://gerrit.libreoffice.org/33692 Tested-by: Jenkins Reviewed-by: Noel Grandin --- stoc/source/servicemanager/servicemanager.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'stoc/source/servicemanager') diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 69ccb3f387b3..eb5685a29b76 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -183,7 +183,7 @@ Any ServiceEnumeration_Impl::nextElement() { MutexGuard aGuard( aMutex ); if( nIt == aFactories.getLength() ) - throw NoSuchElementException(); + throw NoSuchElementException("no more elements"); return Any( &aFactories.getConstArray()[nIt++], cppu::UnoType::get()); } @@ -266,7 +266,7 @@ Any ImplementationEnumeration_Impl::nextElement() { MutexGuard aGuard( aMutex ); if( aIt == aImplementationMap.end() ) - throw NoSuchElementException(); + throw NoSuchElementException("no more elements"); Any ret( &(*aIt), cppu::UnoType::get()); ++aIt; @@ -744,28 +744,28 @@ void OServiceManager::addPropertyChangeListener( const OUString&, const Reference&) { check_undisposed(); - throw UnknownPropertyException(); + throw UnknownPropertyException("unsupported"); } void OServiceManager::removePropertyChangeListener( const OUString&, const Reference&) { check_undisposed(); - throw UnknownPropertyException(); + throw UnknownPropertyException("unsupported"); } void OServiceManager::addVetoableChangeListener( const OUString&, const Reference&) { check_undisposed(); - throw UnknownPropertyException(); + throw UnknownPropertyException("unsupported"); } void OServiceManager::removeVetoableChangeListener( const OUString&, const Reference&) { check_undisposed(); - throw UnknownPropertyException(); + throw UnknownPropertyException("unsupported"); } // OServiceManager @@ -1061,7 +1061,7 @@ void OServiceManager::insert( const Any & Element ) if( Element.getValueTypeClass() != TypeClass_INTERFACE ) { throw IllegalArgumentException( - "no interface given!", + "exception interface, got " + Element.getValueType().getTypeName(), Reference< XInterface >(), 0 ); } Reference xEle( Element, UNO_QUERY_THROW ); @@ -1134,7 +1134,7 @@ void OServiceManager::remove( const Any & Element ) else { throw IllegalArgumentException( - "neither interface nor string given!", + "expected interface or string, got " + Element.getValueType().getTypeName(), Reference< XInterface >(), 0 ); } @@ -1148,7 +1148,7 @@ void OServiceManager::remove( const Any & Element ) if( aIt == m_ImplementationMap.end() ) { throw NoSuchElementException( - "element is not in!", + "element not found", static_cast< OWeakObject * >(this) ); } //First remove all factories which have been loaded by ORegistryServiceManager. -- cgit