ICU-21430 propagate error code

This commit is contained in:
Frank Tang 2020-12-07 19:43:09 -08:00 committed by Frank Yung-Fong Tang
parent 5f8df0d288
commit c3ed0c5371
2 changed files with 3 additions and 2 deletions

View file

@ -1093,7 +1093,7 @@ public:
// place the the replaced locale ID in out and return true.
// Otherwise return false for no replacement or error.
bool replace(
const Locale& locale, CharString& out, UErrorCode status);
const Locale& locale, CharString& out, UErrorCode& status);
private:
const char* language;
@ -1641,7 +1641,7 @@ AliasReplacer::outputToString(
}
bool
AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode status)
AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status)
{
data = AliasData::singleton(status);
if (U_FAILURE(status)) {

View file

@ -6442,4 +6442,5 @@ void LocaleTest::TestLeak21419() {
IcuTestErrorCode status(*this, "TestLeak21419");
Locale l = Locale("s-yU");
l.canonicalize(status);
status.expectErrorAndReset(U_ILLEGAL_ARGUMENT_ERROR);
}