diff --git a/test/tools/yulrun.cpp b/test/tools/yulrun.cpp index a8ff96251..2c90cb662 100644 --- a/test/tools/yulrun.cpp +++ b/test/tools/yulrun.cpp @@ -104,7 +104,7 @@ void interpret(string const& _source) } -int main(int argc, char** argv) +int run(int _argc, char** _argv) { po::options_description options( R"(yulrun, the Yul interpreter. @@ -123,7 +123,7 @@ Allowed options)", po::variables_map arguments; try { - po::command_line_parser cmdLineParser(argc, argv); + po::command_line_parser cmdLineParser(_argc, _argv); cmdLineParser.options(options).positional(filesPositions); po::store(cmdLineParser.run(), arguments); } @@ -159,3 +159,26 @@ Allowed options)", return 0; } + +int main(int argc, char** argv) +{ + try + { + return run(argc, argv); + } + catch (boost::exception const& exception) + { + cerr << "Uncaught exception: " << boost::diagnostic_information(exception) << endl; + return 1; + } + catch (std::exception const& exception) + { + cerr << "Uncaught exception" << (exception.what() ? ": " + string(exception.what()) : ".") << endl; + return 1; + } + catch (...) + { + cerr << "Uncaught exception. No message provided." << endl; + return 1; + } +}