Skip to content

Commit

Permalink
cleanup ErrorKind
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 28, 2024
1 parent 9eaa796 commit edb0a97
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/core/src/commands/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,8 @@ impl PrunePlan {

if version < 2 && opts.repack_uncompressed {
return Err(RusticError::new(
ErrorKind::Config,
"Repository is version 1, cannot repack uncompressed packs. ",
ErrorKind::Unsupported,
"Repacking uncompressed pack is unsupported in Repository version 1.",
)
.attach_context("config version", version.to_string()));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/commands/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ fn restore_contents<P: ProgressBars, S: Open>(
.build()
.map_err(|err| {
RusticError::with_source(
ErrorKind::Multithreading,
ErrorKind::Internal,
"Failed to create the thread pool. Please try again.",
err,
)
Expand Down
2 changes: 0 additions & 2 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ pub enum ErrorKind {
Io,
/// Key Error
Key,
/// Multithreading Error
Multithreading,
/// Parsing Error
Parsing,
/// Password Error
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/repofile/configfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl ConfigFile {
(2, None) => Ok(Some(0)), // use default (=0) zstd compression
(2, Some(c)) => Ok(Some(c)),
_ => Err(RusticError::new(
ErrorKind::Config,
ErrorKind::Unsupported,
"Config version not supported. Please make sure, that you use the correct version.",
)
.attach_context("version", self.version.to_string())),
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/repository/warm_up.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ fn warm_up_repo<P: ProgressBars, S>(
.build()
.map_err(|err| {
RusticError::with_source(
ErrorKind::Multithreading,
"Failed to create thread pool for warm-up",
ErrorKind::Internal,
"Failed to create thread pool for warm-up. Please try again.",
err,
)
})?;
Expand Down

0 comments on commit edb0a97

Please sign in to comment.