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

@@ -34,6 +34,8 @@
#include <wavpack/wavpack.h>
#include <stdexcept>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -490,7 +492,11 @@ wavpack_open_wvc(Decoder &decoder, const char *uri)
free(wvc_url);
};
return decoder_open_uri(decoder, uri, IgnoreError());
try {
return decoder_open_uri(decoder, uri);
} catch (const std::runtime_error &) {
return nullptr;
}
}
/*