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:
parent
c766d5e465
commit
29d10946aa
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user