summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-19 10:56:23 +0100
committerMax Kellermann <max@musicpd.org>2017-12-19 10:56:23 +0100
commit914df18bf93369d279fff85f87c4ac8524f32540 (patch)
treeb73edeeb37923be1c124e608423ad3b5da068958 /src/lib
parenta539094c06114a6be862e219bfc03d6a3513d80b (diff)
Main, ...: catch any exception, not just std::runtime_error
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/icu/CaseFold.cxx3
-rw-r--r--src/lib/icu/Collate.cxx8
-rw-r--r--src/lib/xiph/OggFind.cxx4
3 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/icu/CaseFold.cxx b/src/lib/icu/CaseFold.cxx
index d0f086897..005bff6a1 100644
--- a/src/lib/icu/CaseFold.cxx
+++ b/src/lib/icu/CaseFold.cxx
@@ -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);
}
diff --git a/src/lib/icu/Collate.cxx b/src/lib/icu/Collate.cxx
index 7772785aa..aaff50acf 100644
--- a/src/lib/icu/Collate.cxx
+++ b/src/lib/icu/Collate.cxx
@@ -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;
}
diff --git a/src/lib/xiph/OggFind.cxx b/src/lib/xiph/OggFind.cxx
index 90b0dd41b..d989bcea2 100644
--- a/src/lib/xiph/OggFind.cxx
+++ b/src/lib/xiph/OggFind.cxx
@@ -22,8 +22,6 @@
#include "lib/xiph/OggSyncState.hxx"
#include "input/InputStream.hxx"
-#include <stdexcept>
-
bool
OggFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet)
{
@@ -51,7 +49,7 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is,
try {
is.LockSeek(offset);
- } catch (const std::runtime_error &) {
+ } catch (...) {
return false;
}