aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2022-02-13 12:46:44 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2022-02-13 12:46:44 +0000
commit192a5fd8bbf150ce515519477b466b3a811e8a30 (patch)
tree75169b8687908ade2bd5290847381d35dc550d3d /src
parent4ebb7dcf7fce6459c6d60813d136074c75700240 (diff)
downloadrspamd-192a5fd8bbf150ce515519477b466b3a811e8a30.tar.gz
rspamd-192a5fd8bbf150ce515519477b466b3a811e8a30.zip
[Minor] Improve error reporting
Issue: #4076
Diffstat (limited to 'src')
-rw-r--r--src/libutil/cxx/utf8_util.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libutil/cxx/utf8_util.cxx b/src/libutil/cxx/utf8_util.cxx
index da68c990c..8c727e9ad 100644
--- a/src/libutil/cxx/utf8_util.cxx
+++ b/src/libutil/cxx/utf8_util.cxx
@@ -160,8 +160,14 @@ rspamd_normalise_unicode_inplace(char *start, size_t *len)
struct rspamd_icu_collate_storage {
icu::Collator* collator = nullptr;
rspamd_icu_collate_storage() {
- UErrorCode success = U_ZERO_ERROR;
- collator = icu::Collator::createInstance(icu::Locale::getEnglish(), success);
+ UErrorCode uc_err = U_ZERO_ERROR;
+ collator = icu::Collator::createInstance(icu::Locale::getEnglish(), uc_err);
+
+ if (U_FAILURE(uc_err) || collator == nullptr) {
+ g_error ("fatal error: cannot init libicu collation engine: %s",
+ u_errorName(uc_err));
+ abort();
+ }
/* Ignore all difference except functional */
collator->setStrength(icu::Collator::PRIMARY);
}