Commit 81870d8fa0

81870d8fa01d71153facfe174a91b996afb2c6ec

parent: 7559a2483b

Unregistered key

vaw <git@nlih.de> · 2026-07-24 15:05 UTC
committer: <noreply@github.com>

Pretty-print error on application exit (#595)

Layout: unified · split

src/main.rs +6 −4
@@ -891,7 +891,7 @@ async fn check_import_keys(
891 let encrypted = match encrypt_room_key_export(&keys, &passphrase, 500000) { 891 let encrypted = match encrypt_room_key_export(&keys, &passphrase, 500000) {
892 Ok(encrypted) => encrypted, 892 Ok(encrypted) => encrypted,
893 Err(e) => { 893 Err(e) => {
894 println!("* Failed to encrypt room keys during export: {e}"); 894 eprintln!("* Failed to encrypt room keys during export: {e}");
895 process::exit(2); 895 process::exit(2);
896 }, 896 },
897 }; 897 };
@@ -1118,7 +1118,7 @@ fn setup_logging(settings: &ApplicationSettings) -> tracing_appender::non_blocki
1118 guard 1118 guard
1119} 1119}
1120 1120
1121fn main() -> IambResult<()> { 1121fn main() {
1122 // Parse command-line flags. 1122 // Parse command-line flags.
1123 let iamb = Iamb::parse(); 1123 let iamb = Iamb::parse();
1124 1124
@@ -1144,8 +1144,10 @@ fn main() -> IambResult<()> {
1144 .build() 1144 .build()
1145 .unwrap(); 1145 .unwrap();
1146 1146
1147 rt.block_on(async move { run(settings).await })?; 1147 if let Err(err) = rt.block_on(async move { run(settings).await }) {
1148 eprintln!("\n{err}\n");
1149 process::exit(2);
1150 }
1148 1151
1149 drop(guard); 1152 drop(guard);
1150 process::exit(0);
1151} 1153}