input/Plugin: migrate init() from class Error to C++ exceptions
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "archive/ArchiveList.hxx"
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -91,7 +93,7 @@ dump_input_stream(InputStream *is)
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
try {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: run_input URI\n");
|
||||
return EXIT_FAILURE;
|
||||
@@ -108,10 +110,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
Error error;
|
||||
if (!input_stream_global_init(error)) {
|
||||
LogError(error);
|
||||
return 2;
|
||||
}
|
||||
input_stream_global_init();
|
||||
|
||||
/* open the stream and dump it */
|
||||
|
||||
@@ -142,4 +141,7 @@ int main(int argc, char **argv)
|
||||
config_global_finish();
|
||||
|
||||
return ret;
|
||||
} catch (const std::exception &e) {
|
||||
LogError(e);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user