Go to the documentation of this file. 27 #define MIA_MAIN(callback) \ 28 int main( int argc, char *argv[] ) \ 31 auto verb = getenv("MIA_INITIAL_VERBOSITY"); \ 33 auto level = mia::g_verbose_dict.get_value(verb); \ 34 mia::vstream::instance().set_verbosity(level); \ 36 return callback(argc, argv); \ 38 catch (const std::runtime_error &e){ \ 39 std::cerr << "\n" << argv[0] << " runtime error: " << e.what() << std::endl; \ 41 catch (const std::invalid_argument &e){ \ 42 std::cerr << "\n" << argv[0] << " invalid argument: " << e.what() << std::endl; \ 44 catch (const std::logic_error &e){ \ 45 std::cerr << "\n" << argv[0] << " logic error: " << e.what() << std::endl; \ 47 catch (const std::exception& e){ \ 48 std::cerr << "\n" << argv[0] << " error: " << e.what() << std::endl; \ 51 std::cerr << "\n" << argv[0] << " unknown exception" << std::endl; \ 53 return EXIT_FAILURE; \