input/Plugin: migrate init() from class Error to C++ exceptions
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include "archive/ArchiveList.hxx"
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -63,7 +65,7 @@ dump_input_stream(InputStreamPtr &&is)
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
try {
|
||||
int ret;
|
||||
|
||||
if (argc != 2) {
|
||||
@@ -82,10 +84,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 */
|
||||
|
||||
@@ -116,4 +115,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