pub enum Error {
MissingAuthToken,
InvalidToken,
AuthenticationFailed {
message: String,
},
SessionError {
message: String,
},
InvalidReference {
reference: String,
reason: String,
},
SecretNotFound {
reference: String,
},
AccessDenied {
vault: String,
},
NetworkError {
message: String,
},
SdkError {
message: String,
},
LibraryLoadError {
message: String,
},
JsonError {
message: String,
},
}Expand description
Errors that can occur when using the 1Password client.
Error messages are designed to be helpful for debugging while ensuring that sensitive data (tokens, secret values) is never exposed.
Variants§
MissingAuthToken
The OP_SERVICE_ACCOUNT_TOKEN environment variable is not set
and no explicit token was provided via from_token().
InvalidToken
The provided token has an invalid format.
AuthenticationFailed
Authentication with 1Password failed. This typically means the token is expired or revoked.
SessionError
Failed to establish or maintain the SDK session.
InvalidReference
The secret reference format is invalid.
Valid format: op://vault/item/field or op://vault/item/section/field
Fields
SecretNotFound
The requested secret was not found in 1Password.
AccessDenied
Access to the specified vault was denied. This typically means the service account lacks permission for this vault.
NetworkError
A network error occurred while communicating with 1Password.
SdkError
An error occurred in the underlying 1Password SDK.
LibraryLoadError
Failed to load the native 1Password library.
JsonError
JSON serialization or deserialization error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Check if this error is retriable (e.g., transient network issues).
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if this error indicates an authentication problem.