Skip to content
Draft
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
6 changes: 5 additions & 1 deletion crates/crates_io_trustpub/src/access_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ impl FromStr for AccessToken {
}

/// The error type for parsing access tokens.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum AccessTokenError {
#[error("Missing prefix `{}`", AccessToken::PREFIX)]
MissingPrefix,
#[error("Invalid token length")]
InvalidLength,
#[error("Invalid character in token")]
InvalidCharacter,
#[error("Invalid checksum: claimed `{claimed}`, actual `{actual}`")]
InvalidChecksum { claimed: char, actual: char },
}

Expand Down
Loading