mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 11:33:46 +02:00
bench: surround main() execution with try/catch
so we have a cleaner exit on internal runtime errors. e.g. an unknown priority level.
This commit is contained in:
@@ -118,6 +118,7 @@ int main(int argc, char** argv)
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
benchmark::Args args;
|
benchmark::Args args;
|
||||||
args.asymptote = parseAsymptote(argsman.GetArg("-asymptote", ""));
|
args.asymptote = parseAsymptote(argsman.GetArg("-asymptote", ""));
|
||||||
args.is_list_only = argsman.GetBoolArg("-list", false);
|
args.is_list_only = argsman.GetBoolArg("-list", false);
|
||||||
@@ -131,4 +132,8 @@ int main(int argc, char** argv)
|
|||||||
benchmark::BenchRunner::RunAll(args);
|
benchmark::BenchRunner::RunAll(args);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
tfm::format(std::cerr, "Error: %s\n", e.what());
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user