lib/icu: migrate from class Error to C++ exceptions
This commit is contained in:
@@ -19,24 +19,21 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "Init.hxx"
|
||||
#include "Error.hxx"
|
||||
#include "Collate.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
|
||||
#include <unicode/uclean.h>
|
||||
|
||||
bool
|
||||
IcuInit(Error &error)
|
||||
void
|
||||
IcuInit()
|
||||
{
|
||||
UErrorCode code = U_ZERO_ERROR;
|
||||
u_init(&code);
|
||||
if (U_FAILURE(code)) {
|
||||
error.Format(icu_domain, int(code),
|
||||
"u_init() failed: %s", u_errorName(code));
|
||||
return false;
|
||||
}
|
||||
if (U_FAILURE(code))
|
||||
throw FormatRuntimeError("u_init() failed: %s",
|
||||
u_errorName(code));
|
||||
|
||||
return IcuCollateInit(error);
|
||||
IcuCollateInit();
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user