Skip to content

Commit

Permalink
Fix misleading error message on anchor size check (#1761)
Browse files Browse the repository at this point in the history
Since introducing the device metadata map, only pointing
to aliases to recover space is misleading. Since this is a
technical error the solution hint is simply removed.
  • Loading branch information
Frederik Rothenberger authored Jul 28, 2023
1 parent fbdb5d5 commit 2e00b76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/internet_identity/src/storage/anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ impl fmt::Display for AnchorError {
),
AnchorError::CumulativeDataLimitExceeded { length, limit } => write!(
f,
"Cumulative size of variable sized fields exceeds limit: length {length}, limit {limit}. Either use shorter aliases or remove an existing device."
"Cumulative size of variable sized fields exceeds limit: length {length}, limit {limit}."
),
AnchorError::InvalidDeviceProtection { key_type } => write!(
f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@ fn should_respect_total_size_limit() -> Result<(), CallError> {
);

expect_user_error_with_message(
result,
CanisterCalledTrap,
Regex::new("Cumulative size of variable sized fields exceeds limit: length \\d+, limit \\d+\\. Either use shorter aliases or remove an existing device\\.").unwrap(),
);
result,
CanisterCalledTrap,
Regex::new(
"Cumulative size of variable sized fields exceeds limit: length \\d+, limit \\d+\\.",
)
.unwrap(),
);
Ok(())
}

Expand Down

0 comments on commit 2e00b76

Please sign in to comment.