1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-10 15:04:32 +03:00

surface config errors when running wezterm connect

Broken config could cause the gui to exit before it would normally
print the config warnings and errors, making it harder to understand
what is going on.

This commit bundles the config error text together with whatever
caused it to error out in the fatal error case.
This commit is contained in:
Wez Furlong 2023-03-30 16:19:25 -07:00
parent c766d5e465
commit 29d10946aa
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -816,7 +816,15 @@ fn terminate_with_error_message(err: &str) -> ! {
}
fn terminate_with_error(err: anyhow::Error) -> ! {
terminate_with_error_message(&format!("{:#}", err));
let mut err_text = format!("{err:#}");
let warnings = config::configuration_warnings_and_errors();
if !warnings.is_empty() {
let err = warnings.join("\n");
err_text = format!("{err_text}\nConfiguration Error: {err}");
}
terminate_with_error_message(&err_text)
}
fn main() {