Skip to content

Commit

Permalink
Attach error code to verification error
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 27, 2024
1 parent 5abc923 commit 1a5a536
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/src/backend/decrypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ impl<C: CryptoKey> DecryptBackend<C> {
return Err(
RusticError::new(
ErrorKind::Verification,
"Extra verification failed: After decrypting and decompressing the data changed! The data may be corrupted.\nPlease check the backend for corruption and try again. You can also try to run `rustic check --read-data` to check for corruption. This may take a long time.",
)
"Verification failed: After decrypting and decompressing the data changed! The data may be corrupted.\nPlease check the backend for corruption and try again. You can also try to run `rustic check --read-data` to check for corruption. This may take a long time.",
).attach_error_code("C003")
);
}
}
Expand Down Expand Up @@ -491,8 +491,8 @@ impl<C: CryptoKey> DecryptBackend<C> {
return Err(
RusticError::new(
ErrorKind::Verification,
"Extra verification failed: After decrypting and decompressing the data changed! The data may be corrupted.\nPlease check the backend for corruption and try again. You can also try to run `rustic check --read-data` to check for corruption. This may take a long time.",
)
"Verification failed: After decrypting and decompressing the data changed! The data may be corrupted.\nPlease check the backend for corruption and try again. You can also try to run `rustic check --read-data` to check for corruption. This may take a long time.",
).attach_error_code("C003")
);
}
}
Expand Down

0 comments on commit 1a5a536

Please sign in to comment.