*/src/main: exit on panic
This commit is contained in:
parent
633a418001
commit
41a57cd5f1
|
@ -26,6 +26,13 @@ fn update_max<T: Clone + PartialOrd>(value: &Option<T>, target: &mut Option<T>)
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let orig_hook = std::panic::take_hook();
|
||||
std::panic::set_hook(Box::new(move |panic_info| {
|
||||
// invoke the default handler and exit the process
|
||||
orig_hook(panic_info);
|
||||
std::process::exit(1);
|
||||
}));
|
||||
|
||||
let home = WGS84::from_degrees_and_meters(51.081, 13.728, 0.0);
|
||||
|
||||
let aircrafts = beast::aircrafts::Aircrafts::new();
|
||||
|
|
|
@ -18,6 +18,13 @@ impl std::error::Error for UsageError {}
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
let orig_hook = std::panic::take_hook();
|
||||
std::panic::set_hook(Box::new(move |panic_info| {
|
||||
// invoke the default handler and exit the process
|
||||
orig_hook(panic_info);
|
||||
std::process::exit(1);
|
||||
}));
|
||||
|
||||
tokio::task::LocalSet::new().run_until(async move {
|
||||
let aircrafts = aircrafts::Aircrafts::load("aircraftDatabase.csv");
|
||||
let locations = location::Locations::load("locations.json");
|
||||
|
|
|
@ -34,6 +34,13 @@ impl Aircraft {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let orig_hook = std::panic::take_hook();
|
||||
std::panic::set_hook(Box::new(move |panic_info| {
|
||||
// invoke the default handler and exit the process
|
||||
orig_hook(panic_info);
|
||||
std::process::exit(1);
|
||||
}));
|
||||
|
||||
let aircrafts = beast::aircrafts::Aircrafts::new();
|
||||
aircrafts.connect("radiobert.serv.zentralwerk.org", 30005);
|
||||
|
||||
|
|
Loading…
Reference in New Issue