diff options
author | Max Kellermann <max@musicpd.org> | 2016-09-09 15:37:06 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-09-09 18:15:01 +0200 |
commit | fc7d3f64c007672e4c01172ccb1c46d083a8abd5 (patch) | |
tree | 3c72f16ee6cc919a17558678a1e270568182b8af /src/playlist/plugins | |
parent | 63ab7767a37a99b5651f32e067aeb5fcbb7bd033 (diff) |
input/Plugin: migrate open() from class Error to C++ exceptions
Diffstat (limited to 'src/playlist/plugins')
-rw-r--r-- | src/playlist/plugins/SoundCloudPlaylistPlugin.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx index e18d1abab..67a64ce2e 100644 --- a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx @@ -230,15 +230,9 @@ static constexpr yajl_callbacks parse_callbacks = { static int soundcloud_parse_json(const char *url, yajl_handle hand, Mutex &mutex, Cond &cond) -{ +try { Error error; - auto input_stream = InputStream::OpenReady(url, mutex, cond, - error); - if (input_stream == nullptr) { - if (error.IsDefined()) - LogError(error); - return -1; - } + auto input_stream = InputStream::OpenReady(url, mutex, cond); const ScopeLock protect(mutex); @@ -275,6 +269,9 @@ soundcloud_parse_json(const char *url, yajl_handle hand, } return 0; +} catch (const std::exception &e) { + LogError(e); + return -1; } /** |