mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 16:53:25 +00:00
cleanup: remove remaining ": {source}" from error message templates
This commit is contained in:
parent
1efadd96c8
commit
77ceadbfd0
18 changed files with 79 additions and 81 deletions
|
@ -18,11 +18,11 @@ use thiserror::Error;
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum BuiltinToolError {
|
||||
#[error("Failed to record changes: {0}")]
|
||||
#[error("Failed to record changes")]
|
||||
Record(#[from] scm_record::RecordError),
|
||||
#[error(transparent)]
|
||||
ReadFileBackend(BackendError),
|
||||
#[error("Failed to read file {path:?} with ID {id}: {source}", id = id.hex())]
|
||||
#[error("Failed to read file {path:?} with ID {id}", id = id.hex())]
|
||||
ReadFileIo {
|
||||
path: RepoPathBuf,
|
||||
id: FileId,
|
||||
|
@ -30,14 +30,14 @@ pub enum BuiltinToolError {
|
|||
},
|
||||
#[error(transparent)]
|
||||
ReadSymlink(BackendError),
|
||||
#[error("Failed to decode UTF-8 text for item {item} (this should not happen): {source}")]
|
||||
#[error("Failed to decode UTF-8 text for item {item} (this should not happen)")]
|
||||
DecodeUtf8 {
|
||||
source: std::str::Utf8Error,
|
||||
item: &'static str,
|
||||
},
|
||||
#[error("Rendering {item} {id} is unimplemented for the builtin difftool/mergetool")]
|
||||
Unimplemented { item: &'static str, id: String },
|
||||
#[error("Backend error: {0}")]
|
||||
#[error("Backend error")]
|
||||
BackendError(#[from] jj_lib::backend::BackendError),
|
||||
}
|
||||
|
||||
|
|
|
@ -107,21 +107,18 @@ impl ExternalMergeTool {
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ExternalToolError {
|
||||
#[error("Invalid config: {0}")]
|
||||
#[error("Invalid config")]
|
||||
Config(#[from] ConfigError),
|
||||
#[error(
|
||||
"To use `{tool_name}` as a merge tool, the config `merge-tools.{tool_name}.merge-args` \
|
||||
must be defined (see docs for details)"
|
||||
)]
|
||||
MergeArgsNotConfigured { tool_name: String },
|
||||
#[error("Error setting up temporary directory: {0}")]
|
||||
#[error("Error setting up temporary directory")]
|
||||
SetUpDir(#[source] std::io::Error),
|
||||
// TODO: Remove the "(run with --verbose to see the exact invocation)"
|
||||
// from this and other errors. Print it as a hint but only if --verbose is *not* set.
|
||||
#[error(
|
||||
"Error executing '{tool_binary}' (run with --verbose to see the exact invocation). \
|
||||
{source}"
|
||||
)]
|
||||
#[error("Error executing '{tool_binary}' (run with --verbose to see the exact invocation)")]
|
||||
FailedToExecute {
|
||||
tool_binary: String,
|
||||
#[source]
|
||||
|
@ -129,15 +126,15 @@ pub enum ExternalToolError {
|
|||
},
|
||||
#[error("{}", format_tool_aborted(.exit_status))]
|
||||
ToolAborted { exit_status: ExitStatus },
|
||||
#[error("I/O error: {0}")]
|
||||
#[error("I/O error")]
|
||||
Io(#[source] std::io::Error),
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum DiffCheckoutError {
|
||||
#[error("Failed to write directories to diff: {0}")]
|
||||
#[error("Failed to write directories to diff")]
|
||||
Checkout(#[from] CheckoutError),
|
||||
#[error("Error setting up temporary directory: {0}")]
|
||||
#[error("Error setting up temporary directory")]
|
||||
SetUpDir(#[source] std::io::Error),
|
||||
#[error(transparent)]
|
||||
TreeState(#[from] TreeStateError),
|
||||
|
|
|
@ -45,7 +45,7 @@ pub enum DiffEditError {
|
|||
ExternalTool(#[from] ExternalToolError),
|
||||
#[error(transparent)]
|
||||
DiffCheckoutError(#[from] DiffCheckoutError),
|
||||
#[error("Failed to snapshot changes: {0}")]
|
||||
#[error("Failed to snapshot changes")]
|
||||
Snapshot(#[from] SnapshotError),
|
||||
#[error(transparent)]
|
||||
Config(#[from] config::ConfigError),
|
||||
|
@ -81,7 +81,7 @@ pub enum ConflictResolveError {
|
|||
to see the exact invocation)."
|
||||
)]
|
||||
EmptyOrUnchanged,
|
||||
#[error("Backend error: {0}")]
|
||||
#[error("Backend error")]
|
||||
Backend(#[from] jj_lib::backend::BackendError),
|
||||
}
|
||||
|
||||
|
|
|
@ -196,25 +196,25 @@ pub enum BackendError {
|
|||
object_type: String,
|
||||
hash: String,
|
||||
},
|
||||
#[error("Invalid UTF-8 for object {hash} of type {object_type}: {source}")]
|
||||
#[error("Invalid UTF-8 for object {hash} of type {object_type}")]
|
||||
InvalidUtf8 {
|
||||
object_type: String,
|
||||
hash: String,
|
||||
source: std::str::Utf8Error,
|
||||
},
|
||||
#[error("Object {hash} of type {object_type} not found: {source}")]
|
||||
#[error("Object {hash} of type {object_type} not found")]
|
||||
ObjectNotFound {
|
||||
object_type: String,
|
||||
hash: String,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
#[error("Error when reading object {hash} of type {object_type}: {source}")]
|
||||
#[error("Error when reading object {hash} of type {object_type}")]
|
||||
ReadObject {
|
||||
object_type: String,
|
||||
hash: String,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
#[error("Could not write object of type {object_type}: {source}")]
|
||||
#[error("Could not write object of type {object_type}")]
|
||||
WriteObject {
|
||||
object_type: &'static str,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
|
|
|
@ -37,7 +37,7 @@ use crate::store::Store;
|
|||
|
||||
/// Error while loading index segment file.
|
||||
#[derive(Debug, Error)]
|
||||
#[error("Failed to load commit index file '{name}': {error}")]
|
||||
#[error("Failed to load commit index file '{name}'")]
|
||||
pub struct ReadonlyIndexLoadError {
|
||||
/// Index file name.
|
||||
pub name: String,
|
||||
|
|
|
@ -44,7 +44,7 @@ const SEGMENT_FILE_NAME_LENGTH: usize = 64 * 2;
|
|||
|
||||
/// Error that may occur during `DefaultIndexStore` initialization.
|
||||
#[derive(Debug, Error)]
|
||||
#[error("Failed to initialize index store: {0}")]
|
||||
#[error("Failed to initialize index store")]
|
||||
pub struct DefaultIndexStoreInitError(#[from] pub PathError);
|
||||
|
||||
impl From<DefaultIndexStoreInitError> for BackendInitError {
|
||||
|
@ -56,20 +56,20 @@ impl From<DefaultIndexStoreInitError> for BackendInitError {
|
|||
#[derive(Debug, Error)]
|
||||
pub enum DefaultIndexStoreError {
|
||||
#[error(
|
||||
"Failed to associate commit index file with an operation {op_id}: {source}",
|
||||
"Failed to associate commit index file with an operation {op_id}",
|
||||
op_id = op_id.hex()
|
||||
)]
|
||||
AssociateIndex {
|
||||
op_id: OperationId,
|
||||
source: io::Error,
|
||||
},
|
||||
#[error("Failed to load associated commit index file name: {0}")]
|
||||
#[error("Failed to load associated commit index file name")]
|
||||
LoadAssociation(#[source] io::Error),
|
||||
#[error(transparent)]
|
||||
LoadIndex(ReadonlyIndexLoadError),
|
||||
#[error("Failed to write commit index file: {0}")]
|
||||
#[error("Failed to write commit index file")]
|
||||
SaveIndex(#[source] io::Error),
|
||||
#[error("Failed to index commits at operation {op_id}: {source}", op_id = op_id.hex())]
|
||||
#[error("Failed to index commits at operation {op_id}", op_id = op_id.hex())]
|
||||
IndexCommits {
|
||||
op_id: OperationId,
|
||||
source: BackendError,
|
||||
|
|
|
@ -119,17 +119,17 @@ pub mod watchman {
|
|||
#[allow(missing_docs)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("Could not connect to Watchman: {0}")]
|
||||
WatchmanConnectError(watchman_client::Error),
|
||||
#[error("Could not connect to Watchman")]
|
||||
WatchmanConnectError(#[source] watchman_client::Error),
|
||||
|
||||
#[error("Could not canonicalize working copy root path: {0}")]
|
||||
CanonicalizeRootError(std::io::Error),
|
||||
#[error("Could not canonicalize working copy root path")]
|
||||
CanonicalizeRootError(#[source] std::io::Error),
|
||||
|
||||
#[error("Watchman failed to resolve the working copy root path: {0}")]
|
||||
ResolveRootError(watchman_client::Error),
|
||||
#[error("Watchman failed to resolve the working copy root path")]
|
||||
ResolveRootError(#[source] watchman_client::Error),
|
||||
|
||||
#[error("Failed to query Watchman: {0}")]
|
||||
WatchmanQueryError(watchman_client::Error),
|
||||
#[error("Failed to query Watchman")]
|
||||
WatchmanQueryError(#[source] watchman_client::Error),
|
||||
}
|
||||
|
||||
/// Handle to the underlying Watchman instance.
|
||||
|
|
|
@ -169,13 +169,13 @@ fn resolve_git_ref_to_commit_id(
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum GitImportError {
|
||||
#[error("Failed to read Git HEAD target commit {id}: {err}", id=id.hex())]
|
||||
#[error("Failed to read Git HEAD target commit {id}", id=id.hex())]
|
||||
MissingHeadTarget {
|
||||
id: CommitId,
|
||||
#[source]
|
||||
err: BackendError,
|
||||
},
|
||||
#[error("Ancestor of Git ref {ref_name} is missing: {err}")]
|
||||
#[error("Ancestor of Git ref {ref_name} is missing")]
|
||||
MissingRefAncestor {
|
||||
ref_name: String,
|
||||
#[source]
|
||||
|
@ -186,9 +186,9 @@ pub enum GitImportError {
|
|||
name = REMOTE_NAME_FOR_LOCAL_GIT_REPO
|
||||
)]
|
||||
RemoteReservedForLocalGitRepo,
|
||||
#[error("Unexpected backend error when importing refs: {0}")]
|
||||
#[error("Unexpected backend error when importing refs")]
|
||||
InternalBackend(#[source] BackendError),
|
||||
#[error("Unexpected git error when importing refs: {0}")]
|
||||
#[error("Unexpected git error when importing refs")]
|
||||
InternalGitError(#[source] Box<dyn std::error::Error + Send + Sync>),
|
||||
#[error("The repo is not backed by a Git repo")]
|
||||
UnexpectedBackend,
|
||||
|
@ -550,7 +550,7 @@ pub fn import_head(mut_repo: &mut MutableRepo) -> Result<(), GitImportError> {
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum GitExportError {
|
||||
#[error("Git error: {0}")]
|
||||
#[error("Git error")]
|
||||
InternalGitError(#[source] Box<dyn std::error::Error + Send + Sync>),
|
||||
#[error("The repo is not backed by a Git repo")]
|
||||
UnexpectedBackend,
|
||||
|
@ -1081,10 +1081,10 @@ pub enum GitFetchError {
|
|||
chars = INVALID_REFSPEC_CHARS.iter().join("`, `")
|
||||
)]
|
||||
InvalidBranchPattern,
|
||||
#[error("Failed to import Git refs: {0}")]
|
||||
#[error("Failed to import Git refs")]
|
||||
GitImportError(#[from] GitImportError),
|
||||
// TODO: I'm sure there are other errors possible, such as transport-level errors.
|
||||
#[error("Unexpected git error when fetching: {0}")]
|
||||
#[error("Unexpected git error when fetching")]
|
||||
InternalGitError(#[from] git2::Error),
|
||||
}
|
||||
|
||||
|
@ -1196,7 +1196,7 @@ pub enum GitPushError {
|
|||
RefUpdateRejected(Vec<String>),
|
||||
// TODO: I'm sure there are other errors possible, such as transport-level errors,
|
||||
// and errors caused by the remote rejecting the push.
|
||||
#[error("Unexpected git error when pushing: {0}")]
|
||||
#[error("Unexpected git error when pushing")]
|
||||
InternalGitError(#[from] git2::Error),
|
||||
}
|
||||
|
||||
|
@ -1480,9 +1480,9 @@ pub struct SubmoduleConfig {
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum GitConfigParseError {
|
||||
#[error("Unexpected io error when parsing config: {0}")]
|
||||
#[error("Unexpected io error when parsing config")]
|
||||
IoError(#[from] std::io::Error),
|
||||
#[error("Unexpected git error when parsing config: {0}")]
|
||||
#[error("Unexpected git error when parsing config")]
|
||||
InternalGitError(#[from] git2::Error),
|
||||
}
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ const CONFLICT_SUFFIX: &str = ".jjconflict";
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum GitBackendInitError {
|
||||
#[error("Failed to initialize git repository: {0}")]
|
||||
#[error("Failed to initialize git repository")]
|
||||
InitRepository(#[source] gix::init::Error),
|
||||
#[error("Failed to open git repository: {0}")]
|
||||
#[error("Failed to open git repository")]
|
||||
OpenRepository(#[source] gix::open::Error),
|
||||
#[error(transparent)]
|
||||
Path(PathError),
|
||||
|
@ -72,7 +72,7 @@ impl From<Box<GitBackendInitError>> for BackendInitError {
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum GitBackendLoadError {
|
||||
#[error("Failed to open git repository: {0}")]
|
||||
#[error("Failed to open git repository")]
|
||||
OpenRepository(#[source] gix::open::Error),
|
||||
#[error(transparent)]
|
||||
Path(PathError),
|
||||
|
@ -87,9 +87,9 @@ impl From<Box<GitBackendLoadError>> for BackendLoadError {
|
|||
/// `GitBackend`-specific error that may occur after the backend is loaded.
|
||||
#[derive(Debug, Error)]
|
||||
pub enum GitBackendError {
|
||||
#[error("Failed to read non-git metadata: {0}")]
|
||||
#[error("Failed to read non-git metadata")]
|
||||
ReadMetadata(#[source] TableStoreError),
|
||||
#[error("Failed to write non-git metadata: {0}")]
|
||||
#[error("Failed to write non-git metadata")]
|
||||
WriteMetadata(#[source] TableStoreError),
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ impl From<GitBackendError> for BackendError {
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum GitGcError {
|
||||
#[error("Failed to run git gc command: {0}")]
|
||||
#[error("Failed to run git gc command")]
|
||||
GcCommand(#[source] std::io::Error),
|
||||
#[error("git gc command exited with an error: {0}")]
|
||||
GcCommandErrorStatus(ExitStatus),
|
||||
|
|
|
@ -477,28 +477,28 @@ struct DirectoryToVisit<'a> {
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum TreeStateError {
|
||||
#[error("Reading tree state from {path}: {source}")]
|
||||
#[error("Reading tree state from {path}")]
|
||||
ReadTreeState {
|
||||
path: PathBuf,
|
||||
source: std::io::Error,
|
||||
},
|
||||
#[error("Decoding tree state from {path}: {source}")]
|
||||
#[error("Decoding tree state from {path}")]
|
||||
DecodeTreeState {
|
||||
path: PathBuf,
|
||||
source: prost::DecodeError,
|
||||
},
|
||||
#[error("Writing tree state to temporary file {path}: {source}")]
|
||||
#[error("Writing tree state to temporary file {path}")]
|
||||
WriteTreeState {
|
||||
path: PathBuf,
|
||||
source: std::io::Error,
|
||||
},
|
||||
#[error("Persisting tree state to file {path}: {source}")]
|
||||
#[error("Persisting tree state to file {path}")]
|
||||
PersistTreeState {
|
||||
path: PathBuf,
|
||||
source: std::io::Error,
|
||||
},
|
||||
#[error("Filesystem monitor error: {0}")]
|
||||
Fsmonitor(Box<dyn Error + Send + Sync>),
|
||||
#[error("Filesystem monitor error")]
|
||||
Fsmonitor(#[source] Box<dyn Error + Send + Sync>),
|
||||
}
|
||||
|
||||
impl TreeState {
|
||||
|
|
|
@ -411,19 +411,19 @@ content_hash! {
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum OpStoreError {
|
||||
#[error("Object {hash} of type {object_type} not found: {source}")]
|
||||
#[error("Object {hash} of type {object_type} not found")]
|
||||
ObjectNotFound {
|
||||
object_type: String,
|
||||
hash: String,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
#[error("Error when reading object {hash} of type {object_type}: {source}")]
|
||||
#[error("Error when reading object {hash} of type {object_type}")]
|
||||
ReadObject {
|
||||
object_type: String,
|
||||
hash: String,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
#[error("Could not write object of type {object_type}: {source}")]
|
||||
#[error("Could not write object of type {object_type}")]
|
||||
WriteObject {
|
||||
object_type: &'static str,
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
|
|
|
@ -405,7 +405,7 @@ pub enum StoreLoadError {
|
|||
store: &'static str,
|
||||
store_type: String,
|
||||
},
|
||||
#[error("Failed to read {store} backend type: {source}")]
|
||||
#[error("Failed to read {store} backend type")]
|
||||
ReadError {
|
||||
store: &'static str,
|
||||
source: PathError,
|
||||
|
@ -1398,7 +1398,7 @@ pub struct RewriteRootCommit;
|
|||
/// Error from attempts to edit a commit
|
||||
#[derive(Debug, Error)]
|
||||
pub enum EditCommitError {
|
||||
#[error("Current working-copy commit not found: {0}")]
|
||||
#[error("Current working-copy commit not found")]
|
||||
WorkingCopyCommitNotFound(#[source] BackendError),
|
||||
#[error("Cannot rewrite the root commit")]
|
||||
RewriteRootCommit,
|
||||
|
@ -1407,9 +1407,9 @@ pub enum EditCommitError {
|
|||
/// Error from attempts to check out a commit
|
||||
#[derive(Debug, Error)]
|
||||
pub enum CheckOutCommitError {
|
||||
#[error("Failed to create new working-copy commit: {0}")]
|
||||
#[error("Failed to create new working-copy commit")]
|
||||
CreateCommit(#[from] BackendError),
|
||||
#[error("Failed to edit commit: {0}")]
|
||||
#[error("Failed to edit commit")]
|
||||
EditCommit(#[from] EditCommitError),
|
||||
}
|
||||
|
||||
|
|
|
@ -59,14 +59,14 @@ pub enum RevsetResolutionError {
|
|||
AmbiguousCommitIdPrefix(String),
|
||||
#[error("Change ID prefix \"{0}\" is ambiguous")]
|
||||
AmbiguousChangeIdPrefix(String),
|
||||
#[error("Unexpected error from store: {0}")]
|
||||
#[error("Unexpected error from store")]
|
||||
StoreError(#[source] BackendError),
|
||||
}
|
||||
|
||||
/// Error occurred during revset evaluation.
|
||||
#[derive(Debug, Error)]
|
||||
pub enum RevsetEvaluationError {
|
||||
#[error("Unexpected error from store: {0}")]
|
||||
#[error("Unexpected error from store")]
|
||||
StoreError(#[source] BackendError),
|
||||
#[error("{0}")]
|
||||
Other(String),
|
||||
|
|
|
@ -95,8 +95,8 @@ pub enum SignError {
|
|||
#[error("Invalid signature")]
|
||||
InvalidSignatureFormat,
|
||||
/// A generic error from the backend impl.
|
||||
#[error("Signing error: {0}")]
|
||||
Backend(Box<dyn std::error::Error + Send + Sync>),
|
||||
#[error("Signing error")]
|
||||
Backend(#[source] Box<dyn std::error::Error + Send + Sync>),
|
||||
}
|
||||
|
||||
/// A result type for the signing/verifying operations
|
||||
|
@ -109,8 +109,8 @@ pub enum SignInitError {
|
|||
#[error("Unknown signing backend configured: {0}")]
|
||||
UnknownBackend(String),
|
||||
/// A generic error from the backend impl.
|
||||
#[error("Failed to initialize signing: {0}")]
|
||||
Backend(Box<dyn std::error::Error + Send + Sync>),
|
||||
#[error("Failed to initialize signing")]
|
||||
Backend(#[source] Box<dyn std::error::Error + Send + Sync>),
|
||||
}
|
||||
|
||||
/// A enum that describes if a created/rewritten commit should be signed or not.
|
||||
|
|
|
@ -43,7 +43,7 @@ const OPERATION_ID_LENGTH: usize = 64;
|
|||
const VIEW_ID_LENGTH: usize = 64;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[error("Failed to read {kind} with ID {id}: {err}")]
|
||||
#[error("Failed to read {kind} with ID {id}")]
|
||||
struct DecodeError {
|
||||
kind: &'static str,
|
||||
id: String,
|
||||
|
|
|
@ -41,7 +41,7 @@ pub enum TreeMergeError {
|
|||
source: std::io::Error,
|
||||
file_id: FileId,
|
||||
},
|
||||
#[error("Backend error: {0}")]
|
||||
#[error("Backend error")]
|
||||
BackendError(#[from] BackendError),
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ pub enum SnapshotError {
|
|||
target: PathBuf,
|
||||
},
|
||||
/// Reading or writing from the commit backend failed.
|
||||
#[error("Internal backend error: {0}")]
|
||||
#[error("Internal backend error")]
|
||||
InternalBackendError(#[from] BackendError),
|
||||
/// A file was larger than the specified maximum file size for new
|
||||
/// (previously untracked) files.
|
||||
|
@ -163,7 +163,7 @@ pub enum SnapshotError {
|
|||
max_size: HumanByteSize,
|
||||
},
|
||||
/// Some other error happened while snapshotting the working copy.
|
||||
#[error("{message}: {err}")]
|
||||
#[error("{message}")]
|
||||
Other {
|
||||
/// Error message.
|
||||
message: String,
|
||||
|
@ -233,7 +233,7 @@ pub struct CheckoutStats {
|
|||
pub enum CheckoutError {
|
||||
/// The current working-copy commit was deleted, maybe by an overly
|
||||
/// aggressive GC that happened while the current process was running.
|
||||
#[error("Current working-copy commit not found: {source}")]
|
||||
#[error("Current working-copy commit not found")]
|
||||
SourceNotFound {
|
||||
/// The underlying error.
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
|
@ -243,10 +243,10 @@ pub enum CheckoutError {
|
|||
#[error("Concurrent checkout")]
|
||||
ConcurrentCheckout,
|
||||
/// Reading or writing from the commit backend failed.
|
||||
#[error("Internal backend error: {0}")]
|
||||
#[error("Internal backend error")]
|
||||
InternalBackendError(#[from] BackendError),
|
||||
/// Some other error happened while checking out the working copy.
|
||||
#[error("{message}: {err}")]
|
||||
#[error("{message}")]
|
||||
Other {
|
||||
/// Error message.
|
||||
message: String,
|
||||
|
@ -261,31 +261,32 @@ pub enum CheckoutError {
|
|||
pub enum ResetError {
|
||||
/// The current working-copy commit was deleted, maybe by an overly
|
||||
/// aggressive GC that happened while the current process was running.
|
||||
#[error("Current working-copy commit not found: {source}")]
|
||||
#[error("Current working-copy commit not found")]
|
||||
SourceNotFound {
|
||||
/// The underlying error.
|
||||
source: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
/// Reading or writing from the commit backend failed.
|
||||
#[error("Internal error: {0}")]
|
||||
#[error("Internal error")]
|
||||
InternalBackendError(#[from] BackendError),
|
||||
/// Some other error happened while checking out the working copy.
|
||||
#[error("{message}: {err}")]
|
||||
#[error("{message}")]
|
||||
Other {
|
||||
/// Error message.
|
||||
message: String,
|
||||
#[source]
|
||||
/// The underlying error.
|
||||
#[source]
|
||||
err: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
}
|
||||
|
||||
/// An error while reading the working copy state.
|
||||
#[derive(Debug, Error)]
|
||||
#[error("{message}: {err}")]
|
||||
#[error("{message}")]
|
||||
pub struct WorkingCopyStateError {
|
||||
/// Error message.
|
||||
pub message: String,
|
||||
/// The underlying error.
|
||||
#[source]
|
||||
pub err: Box<dyn std::error::Error + Send + Sync>,
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ pub enum WorkspaceLoadError {
|
|||
RepoDoesNotExist(PathBuf),
|
||||
#[error("There is no Jujutsu repo in {0}")]
|
||||
NoWorkspaceHere(PathBuf),
|
||||
#[error("Cannot read the repo: {0}")]
|
||||
#[error("Cannot read the repo")]
|
||||
StoreLoadError(#[from] StoreLoadError),
|
||||
#[error("Repo path could not be interpreted as Unicode text")]
|
||||
NonUnicodePath,
|
||||
|
|
Loading…
Reference in a new issue