#[non_exhaustive]pub enum Error {
Show 27 variants
BadSignature(MetadataPath),
Encoding(String),
ExpiredMetadata {
path: MetadataPath,
expiration: DateTime<Utc>,
now: DateTime<Utc>,
},
IllegalArgument(String),
Http {
uri: String,
err: Error,
},
Hyper {
uri: String,
err: Error,
},
BadHttpStatus {
uri: String,
code: StatusCode,
},
Io(Error),
IoPath {
path: PathBuf,
err: Error,
},
Json(Error),
NoSupportedHashAlgorithm,
MetadataNotFound {
path: MetadataPath,
version: MetadataVersion,
},
TargetNotFound(TargetPath),
Opaque(String),
UnknownKeyType(String),
UnknownSignatureScheme(String),
MetadataVersionMustBeGreaterThanZero(MetadataPath),
MetadataVersionMustBeSmallerThanMaxU32(MetadataPath),
MetadataThresholdMustBeGreaterThanZero(MetadataPath),
MetadataRoleHasDuplicateKeyId {
role: MetadataPath,
key_id: KeyId,
},
MetadataRoleDoesNotHaveEnoughKeyIds {
role: MetadataPath,
key_ids: usize,
threshold: u32,
},
MetadataMissingSignatures {
role: MetadataPath,
number_of_valid_signatures: u32,
threshold: u32,
},
AttemptedMetadataRollBack {
role: MetadataPath,
trusted_version: u32,
new_version: u32,
},
WrongMetadataVersion {
parent_role: MetadataPath,
child_role: MetadataPath,
expected_version: u32,
new_version: u32,
},
MissingMetadataDescription {
parent_role: MetadataPath,
child_role: MetadataPath,
},
UnauthorizedDelegation {
parent_role: MetadataPath,
child_role: MetadataPath,
},
MissingPrivateKey {
role: MetadataPath,
},
}Expand description
Error type for all TUF related errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadSignature(MetadataPath)
The metadata had a bad signature.
Encoding(String)
There was a problem encoding or decoding.
ExpiredMetadata
Metadata was expired.
Fields
path: MetadataPathThe metadata that expired.
IllegalArgument(String)
An illegal argument was passed into a function.
Http
Generic error for HTTP connections.
Hyper
Errors that can occur parsing HTTP streams.
BadHttpStatus
Unexpected HTTP response status.
Io(Error)
An IO error occurred.
IoPath
An IO error occurred for a path.
Json(Error)
A json serialization error occurred.
NoSupportedHashAlgorithm
There were no available hash algorithms.
MetadataNotFound
The metadata was not found.
TargetNotFound(TargetPath)
The target was not found.
Opaque(String)
Opaque error type, to be interpreted similar to HTTP 500. Something went wrong, and you may or may not be able to do anything about it.
UnknownKeyType(String)
There is no known or available key type.
UnknownSignatureScheme(String)
There is no known or available signature scheme.
MetadataVersionMustBeGreaterThanZero(MetadataPath)
The metadata’s version must be greater than 0.
MetadataVersionMustBeSmallerThanMaxU32(MetadataPath)
The metadata’s version must be less than u32::MAX.
MetadataThresholdMustBeGreaterThanZero(MetadataPath)
The metadata threshold must be greater than 0.
MetadataRoleHasDuplicateKeyId
The metadata role has a duplicate keyid.
MetadataRoleDoesNotHaveEnoughKeyIds
The metadata role does not have enough keyids.
Fields
role: MetadataPathThe metadata.
MetadataMissingSignatures
The metadata was not signed with enough valid signatures.
Fields
role: MetadataPathThe signed metadata.
AttemptedMetadataRollBack
Attempted to update metadata with an older version.
Fields
role: MetadataPathThe metadata.
WrongMetadataVersion
The parent metadata expected the child metadata to be at one version, but was found to be at another version.
Fields
parent_role: MetadataPathThe parent metadata that contains the child metadata’s version.
child_role: MetadataPathThe child metadata that has an unexpected version.
MissingMetadataDescription
The parent metadata does not contain a description of the child metadata.
Fields
parent_role: MetadataPathThe parent metadata that contains the child metadata’s description.
child_role: MetadataPathThe child metadata that should have been contained in the parent.
The parent metadata did not delegate to the child role.
Fields
The parent metadata that did not delegate to the child.
That child metadata that was not delegated to by the parent.
MissingPrivateKey
The metadata must be signed with at least one private key.
Fields
role: MetadataPathThe metadata to be signed.