input/Plugin: migrate open() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 15:37:06 +02:00
parent 63ab7767a3
commit fc7d3f64c0
44 changed files with 359 additions and 461 deletions

View File

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