mirror of
https://github.com/starship/starship.git
synced 2025-01-12 01:18:19 +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::clone::Clone;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::io::ErrorKind;
|
||||||
use std::marker::Sized;
|
use std::marker::Sized;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
@ -236,7 +237,13 @@ impl StarshipConfig {
|
|||||||
Some(content)
|
Some(content)
|
||||||
}
|
}
|
||||||
Err(e) => {
|
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
|
None
|
||||||
}
|
}
|
||||||
}?;
|
}?;
|
||||||
|
Loading…
Reference in New Issue
Block a user