|
@@ -59,6 +59,12 @@ mod rpc;
|
|
|
/// Settings utilities
|
|
/// Settings utilities
|
|
|
mod settings;
|
|
mod settings;
|
|
|
|
|
|
|
|
|
|
+fn panic_hook(panic_info: &std::panic::PanicInfo) {
|
|
|
|
|
+ error!("panic occurred: {panic_info}");
|
|
|
|
|
+ error!("{}", std::backtrace::Backtrace::force_capture().to_string());
|
|
|
|
|
+ std::process::abort()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#[derive(Clone, Debug, Deserialize, StructOpt, StructOptToml)]
|
|
#[derive(Clone, Debug, Deserialize, StructOpt, StructOptToml)]
|
|
|
#[serde(default)]
|
|
#[serde(default)]
|
|
|
#[structopt(name = "darkirc", about = cli_desc!())]
|
|
#[structopt(name = "darkirc", about = cli_desc!())]
|
|
@@ -174,6 +180,9 @@ impl DarkIrc {
|
|
|
|
|
|
|
|
async_daemonize!(realmain);
|
|
async_daemonize!(realmain);
|
|
|
async fn realmain(args: Args, ex: Arc<Executor<'static>>) -> Result<()> {
|
|
async fn realmain(args: Args, ex: Arc<Executor<'static>>) -> Result<()> {
|
|
|
|
|
+ // Abort the application on panic right away
|
|
|
|
|
+ std::panic::set_hook(Box::new(panic_hook));
|
|
|
|
|
+
|
|
|
if args.gen_chacha_keypair {
|
|
if args.gen_chacha_keypair {
|
|
|
let secret = crypto_box::SecretKey::generate(&mut OsRng);
|
|
let secret = crypto_box::SecretKey::generate(&mut OsRng);
|
|
|
let public = secret.public_key();
|
|
let public = secret.public_key();
|