Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8594: Improve error message when greeting attempt is cancelled #8611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion libparsec/crates/client/src/invite/claimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub enum ClaimInProgressError {
ActiveUsersLimitReached,
#[error("The provided user is not allowed to greet this invitation")]
GreeterNotAllowed,
#[error("Greeting attempt cancelled by {origin:?} because {reason:?} on {timestamp}")]
#[error("Greeting attempt cancelled by {origin} because of {reason} on {timestamp}")]
GreetingAttemptCancelled {
origin: GreeterOrClaimer,
reason: CancelledGreetingAttemptReason,
Expand Down
18 changes: 9 additions & 9 deletions libparsec/crates/types/src/invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ impl FromStr for GreeterOrClaimer {
impl Display for GreeterOrClaimer {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Greeter => write!(f, "GREETER"),
Self::Claimer => write!(f, "CLAIMER"),
Self::Greeter => write!(f, "greeter"),
Self::Claimer => write!(f, "claimer"),
}
}
}
Expand Down Expand Up @@ -168,13 +168,13 @@ impl FromStr for CancelledGreetingAttemptReason {
impl std::fmt::Display for CancelledGreetingAttemptReason {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::ManuallyCancelled => write!(f, "MANUALLY_CANCELLED"),
Self::InvalidNonceHash => write!(f, "INVALID_NONCE_HASH"),
Self::InvalidSasCode => write!(f, "INVALID_SAS_CODE"),
Self::UndecipherablePayload => write!(f, "UNDECIPHERABLE_PAYLOAD"),
Self::UndeserializablePayload => write!(f, "UNDESERIALIZABLE_PAYLOAD"),
Self::InconsistentPayload => write!(f, "INCONSISTENT_PAYLOAD"),
Self::AutomaticallyCancelled => write!(f, "AUTOMATICALLY_CANCELLED"),
Self::ManuallyCancelled => write!(f, "manually cancelled"),
Self::InvalidNonceHash => write!(f, "invalid nonce hash"),
Self::InvalidSasCode => write!(f, "invalid sas code"),
Self::UndecipherablePayload => write!(f, "undecipherable payload"),
Self::UndeserializablePayload => write!(f, "undeserializable payload"),
Self::InconsistentPayload => write!(f, "inconsistent payload"),
Self::AutomaticallyCancelled => write!(f, "automatically cancelled"),
}
}
}
Expand Down
Loading