LibUnicode: Print error codes when calls to ICU fail

Primary motivation for this change is the `VERIFY(icu_success(status))`
line in `Segmenter::create()` that was failing on multiple systems and
where we had to ask people to apply a patch to even know what the error
was.

Since this seems to be a recurring problem, let's just add a little
helper function and print the error codes returned by library calls.
This commit is contained in:
InvalidUsernameException
2026-02-21 18:12:46 +01:00
committed by Tim Flynn
parent 77a3de4561
commit 1b2bca7831
Notes: github-actions[bot] 2026-02-21 21:56:43 +00:00
9 changed files with 41 additions and 32 deletions

View File

@@ -248,7 +248,7 @@ NonnullOwnPtr<RelativeTimeFormat> RelativeTimeFormat::create(StringView locale,
static_cast<icu::DecimalFormat&>(*number_formatter).setMinimumGroupingDigits(UNUM_MINIMUM_GROUPING_DIGITS_AUTO);
auto formatter = make<icu::RelativeDateTimeFormatter>(locale_data->locale(), number_formatter, icu_relative_date_time_style(style), UDISPCTX_CAPITALIZATION_NONE, status);
VERIFY(icu_success(status));
verify_icu_success(status);
return make<RelativeTimeFormatImpl>(move(formatter));
}