Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rust/core/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2631,6 +2631,14 @@ mod tests {
),
("invalid_timestamp", AppError::InvalidTimestamp),
("rp_signature_expired", AppError::RpSignatureExpired),
(
"identity_attributes_not_matched",
AppError::IdentityAttributesNotMatched,
),
(
"identity_attribute_mismatch",
AppError::IdentityAttributesNotMatched,
),
];

for (code, expected) in cases {
Expand Down
7 changes: 6 additions & 1 deletion rust/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ pub enum AppError {

/// Identity attributes did not match the required values
#[error("Identity attributes not matched")]
// An early android version using this error code instead of `identity_attributes_not_matched`
#[serde(alias = "identity_attribute_mismatch")]
IdentityAttributesNotMatched,

/// Generic error
Expand Down Expand Up @@ -196,7 +198,10 @@ impl AppError {
"timestamp_too_far_in_future" => Self::TimestampTooFarInFuture,
"invalid_timestamp" => Self::InvalidTimestamp,
"rp_signature_expired" => Self::RpSignatureExpired,
"identity_attributes_not_matched" => Self::IdentityAttributesNotMatched,
// An early android version using this error code instead of `identity_attributes_not_matched`
"identity_attributes_not_matched" | "identity_attribute_mismatch" => {
Self::IdentityAttributesNotMatched
}
_ => Self::GenericError,
}
}
Expand Down
Loading