tdf#42982: improve UNO API error reporting

Change-Id: I82adf31db09d2157ee8f1c776f33e8a0107c3b51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131090
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index be1d986..a1e3801 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -554,7 +554,7 @@ namespace accessibility
        EnsureIsAlive();
        SvTreeListEntry* pEntry = m_pTreeListBox->GetEntry( VCLPoint( _aPoint ) );
        if ( !pEntry )
            throw RuntimeException();
            throw RuntimeException("AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot be empty!");

        Reference< XAccessible > xAcc;
        uno::Reference<XAccessible> xListBox(m_wListBox);
@@ -878,7 +878,7 @@ namespace accessibility

        SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
        if ( !pParent )
            throw RuntimeException();
            throw RuntimeException("AccessibleListBoxEntry::clearAccessibleSelection - pParent cannot be empty!");
        sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
        for ( sal_Int32 i = 0; i < nCount; ++i )
        {
@@ -897,7 +897,7 @@ namespace accessibility

        SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
        if ( !pParent )
            throw RuntimeException();
            throw RuntimeException("AccessibleListBoxEntry::selectAllAccessibleChildren - pParent cannot be empty!");
        sal_Int32 nCount = m_pTreeListBox->GetLevelChildCount( pParent );
        for ( sal_Int32 i = 0; i < nCount; ++i )
        {
@@ -918,7 +918,7 @@ namespace accessibility

        SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
        if ( !pParent )
            throw RuntimeException();
            throw RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChildCount - pParent cannot be empty!");
        nCount = m_pTreeListBox->GetLevelChildCount( pParent );
        for ( i = 0; i < nCount; ++i )
        {
@@ -945,7 +945,7 @@ namespace accessibility

        SvTreeListEntry* pParent = m_pTreeListBox->GetEntryFromPath( m_aEntryPath );
        if ( !pParent )
            throw RuntimeException();
            throw RuntimeException("AccessibleListBoxEntry::getSelectedAccessibleChild - pParent cannot be empty!");
        nCount = m_pTreeListBox->GetLevelChildCount( pParent );
        for ( i = 0; i < nCount; ++i )
        {
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index e9502a2..93feaf9 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -198,7 +198,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >& 
            return m_xAggInv->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
    SbMethodRef pMethod = getMethod( aFunctionName );
    if ( !pMethod.is() )
        throw RuntimeException();
        throw RuntimeException("DocObjectWrapper::invoke - Could not get the method reference!");
    // check number of parameters
    sal_Int32 nParamsCount = aParams.getLength();
    SbxInfo* pInfo = pMethod->GetInfo();