mirror of
https://github.com/starship/starship.git
synced 2025-01-11 17:08:16 +01:00
fix(config): log as error if failure to read config wasn't caused by NotFound (#1993)
This commit is contained in:
parent
f311c3cbf5
commit
60be453797
@ -5,6 +5,7 @@ use indexmap::IndexMap;
|
||||
|
||||
use std::clone::Clone;
|
||||
use std::collections::HashMap;
|
||||
use std::io::ErrorKind;
|
||||
use std::marker::Sized;
|
||||
|
||||
use std::env;
|
||||
@ -236,7 +237,13 @@ impl StarshipConfig {
|
||||
Some(content)
|
||||
}
|
||||
Err(e) => {
|
||||
log::debug!("Unable to read config file content: {}", &e);
|
||||
let level = if e.kind() == ErrorKind::NotFound {
|
||||
log::Level::Debug
|
||||
} else {
|
||||
log::Level::Error
|
||||
};
|
||||
|
||||
log::log!(level, "Unable to read config file content: {}", &e);
|
||||
None
|
||||
}
|
||||
}?;
|
||||
|
Loading…
Reference in New Issue
Block a user