Main, ...: catch any exception, not just std::runtime_error
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
@@ -95,7 +94,7 @@ try {
|
||||
#else
|
||||
#error not implemented
|
||||
#endif
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
return AllocatedString<>::Duplicate(src);
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ IcuCollate(const char *a, const char *b) noexcept
|
||||
|
||||
return ucol_strcoll(collator, au.begin(), au.size(),
|
||||
bu.begin(), bu.size());
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
/* fall back to plain strcasecmp() */
|
||||
return strcasecmp(a, b);
|
||||
}
|
||||
@@ -108,18 +108,18 @@ IcuCollate(const char *a, const char *b) noexcept
|
||||
|
||||
try {
|
||||
wa = MultiByteToWideChar(CP_UTF8, a);
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
try {
|
||||
wb = MultiByteToWideChar(CP_UTF8, b);
|
||||
return -1;
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
wb = MultiByteToWideChar(CP_UTF8, b);
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user