mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
follow xdg base dirs spec by default
This commit is contained in:
parent
c46eaed0e0
commit
85e77832e9
6 changed files with 69 additions and 7 deletions
16
src/error.rs
16
src/error.rs
|
|
@ -75,9 +75,25 @@ pub(crate) enum Observability {
|
|||
#[allow(missing_docs)]
|
||||
#[derive(Error, Debug)]
|
||||
pub(crate) enum Config {
|
||||
#[error("failed to find configuration file")]
|
||||
Search(#[from] ConfigSearch),
|
||||
|
||||
#[error("failed to read configuration file {1:?}")]
|
||||
Read(#[source] std::io::Error, PathBuf),
|
||||
|
||||
#[error("failed to parse configuration file {1:?}")]
|
||||
Parse(#[source] toml::de::Error, PathBuf),
|
||||
}
|
||||
|
||||
/// Errors that can occur while searching for a config file
|
||||
// Missing docs are allowed here since that kind of information should be
|
||||
// encoded in the error messages themselves anyway.
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Error, Debug)]
|
||||
pub(crate) enum ConfigSearch {
|
||||
#[error("XDG Base Directory error")]
|
||||
Xdg(#[from] xdg::BaseDirectoriesError),
|
||||
|
||||
#[error("no relevant configuration files found in XDG Base Directories")]
|
||||
NotFound,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue