mononoke/cmdlib: allow not setting a panic handler

Summary: Sometimes we may not want it.

Reviewed By: StanislavGlebik

Differential Revision: D9840364

fbshipit-source-id: b71a4f1275733aead94b17d21a9bbf4ddc3a8ff2
This commit is contained in:
Jeremy Fitzhardinge 2018-09-20 12:27:01 -07:00 committed by Facebook Github Bot
parent 4ea641671f
commit 7bd0401d65

View File

@ -171,12 +171,15 @@ pub fn get_logger<'a>(matches: &ArgMatches<'a>) -> Logger {
.value_of("panic-fate")
.expect("no default on panic-fate")
{
"continue" => Fate::Continue,
"exit" => Fate::Exit(101),
"abort" => Fate::Abort,
"none" => None,
"continue" => Some(Fate::Continue),
"exit" => Some(Fate::Exit(101)),
"abort" => Some(Fate::Abort),
bad => panic!("bad panic-fate {}", bad),
};
panichandler::set_panichandler(fate);
if let Some(fate) = fate {
panichandler::set_panichandler(fate);
}
let severity = if matches.is_present("debug") {
Severity::Debug