diff options
author | Max Kellermann <max@musicpd.org> | 2016-09-09 18:47:42 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-09-16 17:43:36 +0200 |
commit | 8c744efd5693f2a39b1441d747ebdf0d23faa308 (patch) | |
tree | ee7e99a9b1a235bc1ef554930a3c75dbfabec8d5 /src/decoder/plugins/WavpackDecoderPlugin.cxx | |
parent | 597e59f10da774c7169ee4328c874b21f71f3e60 (diff) |
input/InputStream: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/decoder/plugins/WavpackDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/WavpackDecoderPlugin.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx index 8ab06a761..7dd3ed7b0 100644 --- a/src/decoder/plugins/WavpackDecoderPlugin.cxx +++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx @@ -400,7 +400,12 @@ wavpack_input_set_pos_abs(void *id, uint32_t pos) { WavpackInput &wpi = *wpin(id); - return wpi.is.LockSeek(pos, IgnoreError()) ? 0 : -1; + try { + wpi.is.LockSeek(pos); + return 0; + } catch (const std::runtime_error &) { + return -1; + } } static int @@ -429,7 +434,12 @@ wavpack_input_set_pos_rel(void *id, int32_t delta, int mode) return -1; } - return is.LockSeek(offset, IgnoreError()) ? 0 : -1; + try { + wpi.is.LockSeek(offset); + return 0; + } catch (const std::runtime_error &) { + return -1; + } } static int |