Main, ...: catch any exception, not just std::runtime_error

This commit is contained in:
Max Kellermann
2017-12-19 10:56:23 +01:00
parent a539094c06
commit 914df18bf9
79 changed files with 236 additions and 244 deletions

View File

@@ -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);
}

View File

@@ -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;
}