i18npool/source/breakiterator/breakiteratorImpl.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 27306e0eeee8a22e554f6f5bebccca4f778ae731
Author:     Ian Barkley-Yeung <ibarkleyye...@gmail.com>
AuthorDate: Sun Apr 26 20:18:33 2020 -0700
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Apr 27 09:40:47 2020 +0200

    tdf#42982: Improve UNO API error reporting
    
    Improve error repoting in BreakIteratorImpl
    
    Change-Id: I0be64a758ed81b7a720c8b26af14de6b51cc5dbc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92955
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx 
b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index a6ce162270ef..5037a7c63474 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -53,7 +53,9 @@ BreakIteratorImpl::~BreakIteratorImpl()
 sal_Int32 SAL_CALL BreakIteratorImpl::nextCharacters( const OUString& Text, 
sal_Int32 nStartPos,
         const Locale &rLocale, sal_Int16 nCharacterIteratorMode, sal_Int32 
nCount, sal_Int32& nDone )
 {
-    if (nCount < 0) throw RuntimeException();
+    if (nCount < 0)
+        throw RuntimeException("BreakIteratorImpl::nextCharacters: expected 
nCount >=0, got "
+                               + OUString::number(nCount));
 
     return LBI->nextCharacters( Text, nStartPos, rLocale, 
nCharacterIteratorMode, nCount, nDone);
 }
@@ -61,7 +63,9 @@ sal_Int32 SAL_CALL BreakIteratorImpl::nextCharacters( const 
OUString& Text, sal_
 sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& 
Text, sal_Int32 nStartPos,
         const Locale& rLocale, sal_Int16 nCharacterIteratorMode, sal_Int32 
nCount, sal_Int32& nDone )
 {
-    if (nCount < 0) throw RuntimeException();
+    if (nCount < 0)
+        throw RuntimeException("BreakIteratorImpl::previousCharacters: 
expected nCount >=0, got "
+                               + OUString::number(nCount));
 
     return LBI->previousCharacters( Text, nStartPos, rLocale, 
nCharacterIteratorMode, nCount, nDone);
 }
@@ -647,7 +651,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const 
Locale& rLocale)
             return xBI;
         }
     }
-    throw RuntimeException();
+    throw RuntimeException("getLocaleSpecificBreakIterator: iterator not 
found");
 }
 
 OUString SAL_CALL
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to