8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Avoid thrown exceptions in normal operation when loading non-existent ICU versions. This was a pain in the debugger.

This commit is contained in:
asfernandes 2011-10-12 02:06:25 +00:00
parent bf36c6a366
commit 32fe5b0988

View File

@ -175,9 +175,9 @@ public:
// encapsulate ICU conversion library
struct ImplementConversionICU : public UnicodeUtil::ConversionICU, BaseICU
class ImplementConversionICU : public UnicodeUtil::ConversionICU, BaseICU
{
public:
private:
ImplementConversionICU(int aMajorVersion, int aMinorVersion)
: BaseICU(aMajorVersion, aMinorVersion)
{
@ -186,12 +186,7 @@ public:
module = ModuleLoader::fixAndLoadModule(filename);
if (!module)
{
//(Arg::Gds(isc_random) << "Missing library" <<
// Arg::Gds(isc_random) << filename).raise();
// Instead raise 'empty' exception in order to ignore "Missing library" later
LongJump::raise();
}
return;
try
{
@ -232,6 +227,21 @@ public:
}
}
public:
static ImplementConversionICU* create(int majorVersion, int minorVersion)
{
ImplementConversionICU* o = FB_NEW(*getDefaultMemoryPool()) ImplementConversionICU(
majorVersion, minorVersion);
if (!o->module)
{
delete o;
o = NULL;
}
return o;
}
private:
AutoPtr<ModuleLoader::Module> module;
};
@ -1027,10 +1037,9 @@ UnicodeUtil::ConversionICU& UnicodeUtil::getConversionICU()
{
try
{
convIcu = FB_NEW(*getDefaultMemoryPool()) ImplementConversionICU(*major, minor);
return *convIcu;
if ((convIcu = ImplementConversionICU::create(*major, minor)))
return *convIcu;
}
catch (const LongJump&) { }
catch (const Exception& ex)
{
ex.stuffException(&lastError);