mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-16 00:10:35 +08:00
radicle-surf: reorganise errors
The current `error::Error` type aggregated a lot of different error scenarios that were not for the actual repo actions, instead they would be for the domains that the repo actions would return. This is a reorganisation of those by localising error variants in their modules: * namespace::Error * commit::Error * glob::Error * adding `type Error` to ToCommit * adding `type Error` to Revision The main Error type now consists of these other Error types and lives in the `repo` module. It is re-exported at the top-level since RepositoryRef is the main interaction with the library. During this refactor, some reorganisation of functions was done as well: * Move `get_file` from `Commit` to `RepositoryRef` as `get_commit_file`. * Have a blanket implementation of `ToCommit` for any `Revision`, instead of repeating the implementations. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -27,7 +27,7 @@ use serde::{
|
||||
use crate::{
|
||||
diff,
|
||||
file_system,
|
||||
git::{self, Glob, RepositoryRef},
|
||||
git::{self, glob, Glob, RepositoryRef},
|
||||
person::Person,
|
||||
revision::Revision,
|
||||
};
|
||||
@@ -251,7 +251,10 @@ pub enum Error {
|
||||
|
||||
/// An error occurred during a git operation.
|
||||
#[error(transparent)]
|
||||
Git(#[from] git::error::Error),
|
||||
Git(#[from] git::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
Glob(#[from] glob::Error),
|
||||
|
||||
/// Trying to find a file path which could not be found.
|
||||
#[error("the path '{0}' was not found")]
|
||||
|
||||
Reference in New Issue
Block a user