summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorIan Barkley-Yeung <ibarkleyyeung@gmail.com>2020-04-26 20:18:33 -0700
committerStephan Bergmann <sbergman@redhat.com>2020-04-27 09:40:47 +0200
commit27306e0eeee8a22e554f6f5bebccca4f778ae731 (patch)
treef11478eefafdb13f999bd71c46abac5571fc8006 /i18npool
parente6df5847379a97ad2de95a3c01cb11380c56e0f7 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx10
1 files changed, 7 insertions, 3 deletions
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