chore: remove dependency on terrors
This commit is contained in:
parent
85d38ede56
commit
f56ac321f4
5 changed files with 9 additions and 17 deletions
|
@ -66,9 +66,6 @@ derive_more = { version = "1.0.0-beta.6", features = [
|
|||
"from",
|
||||
] }
|
||||
|
||||
# error handling
|
||||
terrors = "0.3"
|
||||
|
||||
# file watcher
|
||||
inotify = "0.10"
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ secrecy = { workspace = true }
|
|||
#
|
||||
# # error handling
|
||||
derive_more = { workspace = true }
|
||||
# terrors = { workspace = true }
|
||||
#
|
||||
# # file watcher
|
||||
# inotify = { workspace = true }
|
||||
|
|
|
@ -48,7 +48,6 @@ secrecy = { workspace = true }
|
|||
|
||||
# error handling
|
||||
derive_more = { workspace = true }
|
||||
# terrors = { workspace = true }
|
||||
|
||||
# # file watcher
|
||||
# inotify = { workspace = true }
|
||||
|
|
|
@ -47,9 +47,8 @@ bytes = { workspace = true }
|
|||
ulid = { workspace = true }
|
||||
warp = { workspace = true }
|
||||
|
||||
# error handling
|
||||
# boilerplate
|
||||
derive_more = { workspace = true }
|
||||
terrors = { workspace = true }
|
||||
|
||||
# file watcher
|
||||
inotify = { workspace = true }
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
use git_next_config::{BranchName, RepoConfig};
|
||||
use git_next_git::RepoDetails;
|
||||
use terrors::OneOf;
|
||||
use tracing::error;
|
||||
|
||||
use crate::gitforge::{self, ForgeFileError};
|
||||
|
||||
pub async fn load(
|
||||
details: &RepoDetails,
|
||||
forge: &gitforge::Forge,
|
||||
) -> Result<RepoConfig, OneOf<(ForgeFileError, crate::config::Error, toml::de::Error, Error)>> {
|
||||
pub async fn load(details: &RepoDetails, forge: &gitforge::Forge) -> Result<RepoConfig, Error> {
|
||||
let contents = forge
|
||||
.file_contents_get(&details.branch, ".git-next.toml")
|
||||
.await
|
||||
.map_err(OneOf::new)?;
|
||||
let config = RepoConfig::load(&contents).map_err(OneOf::new)?;
|
||||
let config = validate(config, forge).await.map_err(OneOf::new)?;
|
||||
.await?;
|
||||
let config = RepoConfig::load(&contents)?;
|
||||
let config = validate(config, forge).await?;
|
||||
Ok(config)
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, derive_more::From, derive_more::Display)]
|
||||
pub enum Error {
|
||||
File(ForgeFileError),
|
||||
Config(crate::config::Error),
|
||||
Toml(toml::de::Error),
|
||||
Forge(gitforge::ForgeBranchError),
|
||||
BranchNotFound(BranchName),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue