summaryrefslogtreecommitdiff
path: root/comphelper/source/container
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-18 15:05:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-20 09:03:45 +0100
commitbca1b74c0753f2305a5e234293df88aa3e1d9af0 (patch)
tree16732572c6e15dbd5a2f4e50a2451efc836e3a2d /comphelper/source/container
parent35a564864e6ce08abfa4924e1ea9314982e7957c (diff)
improve some IllegalArgumentException messages
Change-Id: Id88f2a82bf2651e8b5895aa330f32b71ff5b0e48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109546 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source/container')
-rw-r--r--comphelper/source/container/IndexedPropertyValuesContainer.cxx4
-rw-r--r--comphelper/source/container/NamedPropertyValuesContainer.cxx4
-rw-r--r--comphelper/source/container/enumerablemap.cxx2
-rw-r--r--comphelper/source/container/namecontainer.cxx4
4 files changed, 7 insertions, 7 deletions
diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
index fe4ba0cff91a..639fb625797e 100644
--- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
@@ -80,7 +80,7 @@ void SAL_CALL IndexedPropertyValuesContainer::insertByIndex( sal_Int32 nIndex, c
uno::Sequence<beans::PropertyValue> aProps;
if (!(aElement >>= aProps))
- throw lang::IllegalArgumentException();
+ throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2);
if (nSize == nIndex)
maProperties.push_back(aProps);
else
@@ -104,7 +104,7 @@ void SAL_CALL IndexedPropertyValuesContainer::replaceByIndex( sal_Int32 nIndex,
uno::Sequence<beans::PropertyValue> aProps;
if (!(aElement >>= aProps))
- throw lang::IllegalArgumentException();
+ throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2);
maProperties[nIndex] = aProps;
}
diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx
index 79a7d714b5e6..dbd0e422b5fb 100644
--- a/comphelper/source/container/NamedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx
@@ -78,7 +78,7 @@ void SAL_CALL NamedPropertyValuesContainer::insertByName( const OUString& aName,
uno::Sequence<beans::PropertyValue> aProps;
if( !(aElement >>= aProps ) )
- throw lang::IllegalArgumentException();
+ throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2);
maProperties.emplace( aName, aProps );
}
@@ -101,7 +101,7 @@ void SAL_CALL NamedPropertyValuesContainer::replaceByName( const OUString& aName
uno::Sequence<beans::PropertyValue> aProps;
if( !(aElement >>= aProps) )
- throw lang::IllegalArgumentException();
+ throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2);
(*aIter).second = aProps;
}
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 1730d2dc2668..ae6053d7520c 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -326,7 +326,7 @@ namespace comphelper
sal_Int32 nArgumentCount = _arguments.getLength();
if ( ( nArgumentCount != 2 ) && ( nArgumentCount != 3 ) )
- throw IllegalArgumentException();
+ throw IllegalArgumentException("wrong number of args", static_cast<cppu::OWeakObject*>(this), 1);
Type aKeyType, aValueType;
if ( !( _arguments[0] >>= aKeyType ) )
diff --git a/comphelper/source/container/namecontainer.cxx b/comphelper/source/container/namecontainer.cxx
index bed257ca50c7..fc43d871d7e4 100644
--- a/comphelper/source/container/namecontainer.cxx
+++ b/comphelper/source/container/namecontainer.cxx
@@ -85,7 +85,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aEl
throw ElementExistException();
if( aElement.getValueType() != maType )
- throw IllegalArgumentException();
+ throw IllegalArgumentException("element is wrong type", static_cast<cppu::OWeakObject*>(this), 2);
maProperties.emplace(aName,aElement);
}
@@ -112,7 +112,7 @@ void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aE
throw NoSuchElementException();
if( aElement.getValueType() != maType )
- throw IllegalArgumentException();
+ throw IllegalArgumentException("element is wrong type", static_cast<cppu::OWeakObject*>(this), 2);
(*aIter).second = aElement;
}