Skip to content

Commit b1a9d5a

Browse files
client/file: Use a different message if all items fail to decrypt
1 parent c5eaeaf commit b1a9d5a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

client/src/file/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ impl Keyring {
172172
n_valid_items += 1;
173173
}
174174
}
175-
176-
if n_broken_items > n_valid_items {
175+
if n_valid_items == 0 && n_broken_items != 0 {
176+
#[cfg(feature = "tracing")]
177+
tracing::error!("Keyring cannot be decrypted. Invalid secret.");
178+
return Err(Error::IncorrectSecret);
179+
} else if n_broken_items > n_valid_items {
177180
#[cfg(feature = "tracing")]
178181
{
179182
tracing::warn!(

0 commit comments

Comments
 (0)