summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorAnkit_Jaipuriar <ankitjaipuriar07@gmail.com>2023-09-24 11:49:28 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2023-10-13 20:00:19 +0200
commita97ceaf14e294373b864c61c930f8723e13747c7 (patch)
treedb678b594443240916355954d08f578008cf3ea9 /i18npool
parent9bc2aede99017ed0338e97b21b4735919b705b47 (diff)
tdf#42982 Improved UNO API error reporting
Change-Id: I62862c8dd83b587e56177afd2ec05af1f567f6ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157201 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 7e19e863bc70..4927a82293fc 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -146,7 +146,8 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
status = U_ZERO_ERROR;
udata_setAppData("OpenOffice", OpenOffice_dat, &status);
- if ( !U_SUCCESS(status) ) throw uno::RuntimeException();
+ if ( !U_SUCCESS(status) )
+ throw uno::RuntimeException("udata_setAppData returned error " + OUString::createFromAscii(u_errorName(status)));
std::shared_ptr<OOoRuleBasedBreakIterator> rbi;
@@ -273,14 +274,14 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
break;
}
if ( !U_SUCCESS(status) || !pBI ) {
- throw uno::RuntimeException();
+ throw uno::RuntimeException("Failed to create ICU BreakIterator: error " + OUString::createFromAscii(u_errorName(status)));
}
icuBI->mpValue = std::make_shared<BI_ValueData>();
icuBI->mpValue->mpBreakIterator = pBI;
theBIMap.insert( std::make_pair( aBIMapLocaleTypeKey, icuBI->mpValue));
} while (false);
if (!icuBI->mpValue || !icuBI->mpValue->mpBreakIterator) {
- throw uno::RuntimeException();
+ throw uno::RuntimeException("ICU BreakIterator is not properly initialized");
}
icuBI->maBIMapKey = aBIMapGlobalKey;
if (!bInMap)
@@ -297,12 +298,12 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
icuBI->mpValue->mpUt = utext_openUChars(icuBI->mpValue->mpUt, pText, rText.getLength(), &status);
if (!U_SUCCESS(status))
- throw uno::RuntimeException();
+ throw uno::RuntimeException("utext_openUChars returned error " + OUString::createFromAscii(u_errorName(status)));
icuBI->mpValue->mpBreakIterator->setText(icuBI->mpValue->mpUt, status);
if (!U_SUCCESS(status))
- throw uno::RuntimeException();
+ throw uno::RuntimeException("Failed to set text for ICU BreakIterator: error " + OUString::createFromAscii(u_errorName(status)));
icuBI->mpValue->maICUText = rText;
}