sos_sdk

Enum Error

Source
pub enum Error {
Show 134 variants Message(String), PermissionDenied, NotFile(PathBuf), NotAuthenticated, NoCache, NoSearchIndex, NoFilePassword, NoOpenFolder, NoDevice, NoDefaultFolder, PemEncoding, NotFileContent, NotArchived, NoArchive, AlreadyArchived, NoContactsFolder, NotContact, NoSigner, RecoveryThreshold(u8), BadCipher(String, String), NotDirectory(PathBuf), InvalidKeyValue(String), BadIdentity(u8, usize, String), IdentityLength, VaultIdentifierMismatch(VaultId, VaultId), UnknownCipher(u8), InvalidCipher(String), InvalidKeyDerivation(String), UnknownSecretKind(u8), UnknownEventKind(u16), UnknownIdentityKind(u8), UnknownSharedAccessKind(u8), InvalidNonce, NoChangeEvent, VaultLocked, SecretAlreadyExists(String), SecretDoesNotExist(Uuid), DicewareWordsTooFew(usize, u8), PassphraseVerification, NotIdentityFolder, NoSecretUrn(VaultId, Urn), NoSecretId(VaultId, SecretId), NoSigningKey, NoIdentityKey, VaultNotInit, VaultAlreadyInit, UnknownKeyTypeId, InvalidPublicKeyLength(u8, usize), VaultHashMismatch { commit: String, value: String, id: Uuid, }, HashMismatch { commit: String, value: String, }, CreateEventMustBeFirst, CreateEventOnlyFirst, NoRootCommit, NoLastCommit, CommitNotFound(CommitHash), RewindLeavesLength, InvalidMethod(u16), NotDigit, InvalidVaultFlags, InvalidSecretFlags, UnknownPurpose(u8), NoArchiveManifest, NoArchiveVault(PathBuf), ArchiveChecksumMismatch(String), ZipDateTime, AgeIdentityParse(String), NoFolderPassword(VaultId), NoFileEncryptionPassword, VaultEntryKind(String), NoArchiveAccount(String), ArchiveAccountAlreadyExists(String), NoDefaultVault(String), NoVaultFile(String), NoAccount(String), ArchiveAddressMismatch, NoArchiveDefaultVault, NoSession, BadSessionIdentity, NoSessionIdentity, NoSessionSalt, NoSessionSharedSecret, NoSessionKey, BadNonce, NotEcdsaKey, NotEd25519Key, NotSymmetric, NotAsymmetric, InvalidX25519Identity(String), FieldNotFound(SecretId), CacheNotAvailable(Uuid), VaultUnlockFail, NoOpenVault, SecretNotFound(SecretId), InvalidExternalFile(String), BadAddressPrefix, InvalidLength(usize), RecoveryId, AccountLocked, CheckpointVerification { checkpoint: CommitHash, computed: CommitHash, snapshot: Option<PathBuf>, rollback_completed: bool, }, EventTimeBehind, Boxed(Box<dyn Error + Send + Sync>), Io(Error), Hex(FromHexError), PasswordHash(Error), ParseInt(ParseIntError), UrlParse(ParseError), Uuid(Error), TryFromSlice(TryFromSliceError), Elliptic(Error), Merkle(Error), Time(ComponentRange), TimeFormat(Format), TimeParse(Parse), InvalidFormat(InvalidFormatDescription), Pem(PemError), Json(Error), ChaCha(Error), Urn(Error), Zip(ZipError), TryFromInt(TryFromIntError), Ed25519(Error), Base58(Error), Sha2DigestLength(InvalidLength), AgeEncrypt(EncryptError), AgeDecrypt(DecryptError), Walk(Error), StripPrefix(StripPrefixError), Join(JoinError), Vsss(String), Utf8String(Utf8Error), Vcard(Error), Migrate(Error), MpscLockedNotify(SendError<()>), TotpUrl(TotpUrlError),
}
Expand description

Error thrown by the core library.

Variants§

§

Message(String)

Generic error message used when converting from some libraries that return a String as an error.

§

PermissionDenied

Permission denied.

If a shared vault is set to private shared access and somebody other than the owner attempts to write to encrypt a shared entry this error is generated.

§

NotFile(PathBuf)

Error generated when a path is not a file.

§

NotAuthenticated

Error generated accessing an account that is not authenticated.

§

NoCache

Error generated if we could not determine a cache directory.

§

NoSearchIndex

Error generated when a search index is required.

§

NoFilePassword

Error generated when a file encryption password is required.

§

NoOpenFolder

Error generated when an open folder is expected.

§

NoDevice

Error generated when a device signer is expected.

§

NoDefaultFolder

Error generated when no default folder is available.

§

PemEncoding

Error generated when a PEM-encoded certificate is invalid.

§

NotFileContent

Error generated when a file secret is expected.

§

NotArchived

Error generated when attempting to unarchive a secret that is not archived.

§

NoArchive

Error generated when an archive folder is not available.

§

AlreadyArchived

Error generated when attempting to archive a secret that is already archived.

§

NoContactsFolder

Available on crate feature contacts only.

Error generated when a contacts folder is not available.

§

NotContact

Available on crate feature contacts only.

Error generated when a secret is not a contact secret.

§

NoSigner

Error generated when a signing key is required.

§

RecoveryThreshold(u8)

Error generated when a recovery group threshold is too small.

§

BadCipher(String, String)

Error generated attempting to encrypt or decrypt with the wrong cipher.

§

NotDirectory(PathBuf)

Error generated when a directory is expected.

§

InvalidKeyValue(String)

Error generated when attempting to parse a key/value pair.

§

BadIdentity(u8, usize, String)

Error generated when a vault identity byte is wrong.

§

IdentityLength

Error generated when a buffer used to read identity bytes is not long enough.

§

VaultIdentifierMismatch(VaultId, VaultId)

Error generated when vault identifiers must match.

§

UnknownCipher(u8)

Error generated when a vault cipher identifier byte is wrong.

§

InvalidCipher(String)

Error generated when a vault cipher string identifier is wrong.

§

InvalidKeyDerivation(String)

Error generated when a vault key derivation function string identifier is wrong.

§

UnknownSecretKind(u8)

Error generated when the kind of a secret is unknown.

§

UnknownEventKind(u16)

Error generated when the kind identifier of an event is unknown.

§

UnknownIdentityKind(u8)

Error generated when the kind of an identification secret is unknown.

§

UnknownSharedAccessKind(u8)

Error generated when the kind of a shared access variant is unknown.

§

InvalidNonce

Error generated when an AeadPack contains a nonce that is invalid for the decryption cipher.

§

NoChangeEvent

👎Deprecated

Error generated attempting to convert to a change event.

§

VaultLocked

Error generated when a vault is locked.

§

SecretAlreadyExists(String)

Error generated when a secret already exists with the given label.

§

SecretDoesNotExist(Uuid)

Error generated when a secret does not exist for an update operation.

§

DicewareWordsTooFew(usize, u8)

Error generated when secret meta data does not exist.

§

PassphraseVerification

Error generated when attempting to verify a password fails.

This can happen when calling verify() on a Vault or unlock() on a Gatekeeper.

§

NotIdentityFolder

Error generated when a login vault does not contain the identity bit flag.

§

NoSecretUrn(VaultId, Urn)

Error generated when a vault does not contain a secret by URN.

§

NoSecretId(VaultId, SecretId)

Error generated when a vault does not contain a secret by identifier.

§

NoSigningKey

Error generated when a signing key could not be found in an identity vault.

§

NoIdentityKey

Error generated when an identity key could not be found in an identity vault.

§

VaultNotInit

Error generated when a vault has not been initialized (no encrypted meta data).

§

VaultAlreadyInit

Error generated attempting to a initialize a vault when it has already been initialized.

§

UnknownKeyTypeId

Error generated when the type identifier for a public key is unknown.

§

InvalidPublicKeyLength(u8, usize)

Error generated when a public key has the wrong length.

§

VaultHashMismatch

Error generated when event log row data does not match the commit hash.

Fields

§commit: String

Expected commit hash.

§value: String

Commit hash of the value.

§id: Uuid

Record identifier.

§

HashMismatch

Error generated when event log row data does not match the commit hash.

Fields

§commit: String

Expected commit hash.

§value: String

Commit hash of the value.

§

CreateEventMustBeFirst

Error generated when a a event log file does not begin with a create vault event.

§

CreateEventOnlyFirst

Error generated when a event log create vault event is not the first record.

§

NoRootCommit

Error generated when a commit tree is expected to have a root.

§

NoLastCommit

Error generated when a commit tree is expected to have a last commit.

§

CommitNotFound(CommitHash)

Error generated when a target commit hash could not be found.

§

RewindLeavesLength

Error generated trying to rewind an event log.

§

InvalidMethod(u16)

Error generated when an RPC method kind is invalid.

§

NotDigit

Error generated when a value is expected to be all digits.

§

InvalidVaultFlags

Error generated when decoding vault flags has invalid bits.

§

InvalidSecretFlags

Error generated when decoding secret flags has invalid bits.

§

UnknownPurpose(u8)

Error generated when decoding a vault purpose identifier that is not known.

§

NoArchiveManifest

Error generated an archive does not contain a manifest file.

§

NoArchiveVault(PathBuf)

Error generated an archive does not contain a manifest file.

§

ArchiveChecksumMismatch(String)

Error generated an archive does not contain a manifest file.

§

ZipDateTime

Error generated converting now to the zip date time format.

§

AgeIdentityParse(String)

Error generated parsing an AGE identity from a string.

§

NoFolderPassword(VaultId)

Error generated when a folder password in the identity vault could not be located.

§

NoFileEncryptionPassword

Error generated when a file encryption password could not be found.

§

VaultEntryKind(String)

Error generated when a vault entry in an identity vault is of the wrong secret kind.

§

NoArchiveAccount(String)

Error generated when an archive is for an address that does not exist locally when we are expecting an archive to be imported in the context of an existing account.

§

ArchiveAccountAlreadyExists(String)

Error generated attempting to restore an account from an archive whilst not authenticated and the address for the archive matches an account that already exists.

§

NoDefaultVault(String)

Error generated when the default vault for an account could not be found.

§

NoVaultFile(String)

Error generated when a vault file could not be located.

§

NoAccount(String)

Error generated when an account does not exist.

§

ArchiveAddressMismatch

Error generated when an archive signing key address does not match the address in the archive manifest.

§

NoArchiveDefaultVault

Error generated when an archive does not contain a default vault.

§

NoSession

Error generated when a session does not exist.

§

BadSessionIdentity

Error generated when a session identity signature does not match the initial address.

§

NoSessionIdentity

Error generated when attempting to compute a shared secret before a session identity has been proven.

§

NoSessionSalt

Error generated when a session does not yet have a salt.

§

NoSessionSharedSecret

Error generated when a session shared secret has not yet been created.

§

NoSessionKey

Error generated when a session key does not exist.

§

BadNonce

Error generated when a session receives a nonce that is equal to or less than the current server session nonce.

§

NotEcdsaKey

Error generated when an ECDSA signing key is expected.

§

NotEd25519Key

Error generated when an Ed25519 signing key is expected.

§

NotSymmetric

Error generated when attempting to use an asymmetric private key with a symmetric cipher.

§

NotAsymmetric

Error generated when attempting to use a symmetric private key with an asymmetric cipher.

§

InvalidX25519Identity(String)

Error generated when attempting to parse an AGE identity.

§

FieldNotFound(SecretId)

Error generated when an attachment could not be found.

§

CacheNotAvailable(Uuid)

Error generated attempting to access a vault that is not available.

§

VaultUnlockFail

Error generated when unlocking a vault failed.

§

NoOpenVault

Error generated attempting to make changes to the current vault but no vault is open.

§

SecretNotFound(SecretId)

Error generated when a secret could not be found.

§

InvalidExternalFile(String)

Error generated when an external file could not be parsed.

§

BadAddressPrefix

Error generated when an address has the wrong prefix.

§

InvalidLength(usize)

Invalid length, secp256k1 signatures are 65 bytes

§

RecoveryId

Expected a recovery identifier.

§

AccountLocked

Account is already locked.

§

CheckpointVerification

Error generated when replacing events in an event log does not compute the same root hash as the expected checkpoint.

Fields

§checkpoint: CommitHash

Checkpoint root hash.

§computed: CommitHash

Computed root hash.

§snapshot: Option<PathBuf>

Snapshot path.

§rollback_completed: bool

Whether a rollback completed.

§

EventTimeBehind

Attempt to apply a patch whose timestamp of the first event is younger than the last event in the log file.

Typically, this can happen when clocks are out of sync.

§

Boxed(Box<dyn Error + Send + Sync>)

Generic boxed error.

§

Io(Error)

Error generated by password hash.

§

Hex(FromHexError)

Error generated by password hash.

§

PasswordHash(Error)

Error generated by password hash.

§

ParseInt(ParseIntError)

Error generated parsing integers.

§

UrlParse(ParseError)

Error generated parsing URLs.

§

Uuid(Error)

Error generated parsing UUIDs.

§

TryFromSlice(TryFromSliceError)

Error generated converting to fixed length slice.

§

Elliptic(Error)

Error generated during AES encryption and decryption. Error generated by elliptic curve library.

§

Merkle(Error)

Error generated by the merkle tree library.

§

Time(ComponentRange)

Error generated converting time types.

§

TimeFormat(Format)

Error generated formatting time.

§

TimeParse(Parse)

Error generated parsing time.

§

InvalidFormat(InvalidFormatDescription)

Error generated creating format descriptions for date formatting.

§

Pem(PemError)

Error generated parsing PEM files.

§

Json(Error)

Error generated by the JSON library.

§

ChaCha(Error)

Error generated by the crypto library.

§

Urn(Error)

Error generated by the URN library.

§

Zip(ZipError)

Available on crate features archive or migrate only.

Error generated by the async zip library.

§

TryFromInt(TryFromIntError)

Error generated when converting integers.

§

Ed25519(Error)

Error generated by the Ed25519 library.

§

Base58(Error)

Error generated by the Base58 library.

§

Sha2DigestLength(InvalidLength)

Error generated by the SHA2 library.

§

AgeEncrypt(EncryptError)

Error generated by the AGE library when encrypting.

§

AgeDecrypt(DecryptError)

Error generated by the AGE library when decrypting.

§

Walk(Error)

Error generated when walking a directory.

§

StripPrefix(StripPrefixError)

Error generated when stripping a prefix from a path.

§

Join(JoinError)

Error generated when attempting to join a task.

§

Vsss(String)

Error generated by verifiable secret sharing library.

§

Utf8String(Utf8Error)

Error generated converting from UTF8.

§

Vcard(Error)

Available on crate feature contacts only.

Error generated by the vcard library.

§

Migrate(Error)

Available on crate feature migrate only.

Error generated by the migrate library.

§

MpscLockedNotify(SendError<()>)

Error generated by the signin notifications channel.

§

TotpUrl(TotpUrlError)

Error generated by the TOTP library.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Box<dyn Error + Send + Sync>> for Error

Source§

fn from(source: Box<dyn Error + Send + Sync>) -> Self

Converts to this type from the input type.
Source§

impl From<ComponentRange> for Error

Source§

fn from(source: ComponentRange) -> Self

Converts to this type from the input type.
Source§

impl From<DecryptError> for Error

Source§

fn from(source: DecryptError) -> Self

Converts to this type from the input type.
Source§

impl From<EncryptError> for Error

Source§

fn from(source: EncryptError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Format> for Error

Source§

fn from(source: Format) -> Self

Converts to this type from the input type.
Source§

impl From<FromHexError> for Error

Source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidFormatDescription> for Error

Source§

fn from(source: InvalidFormatDescription) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidLength> for Error

Source§

fn from(source: InvalidLength) -> Self

Converts to this type from the input type.
Source§

impl From<JoinError> for Error

Source§

fn from(source: JoinError) -> Self

Converts to this type from the input type.
Source§

impl From<Parse> for Error

Source§

fn from(source: Parse) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for Error

Source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for Error

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl From<PemError> for Error

Source§

fn from(source: PemError) -> Self

Converts to this type from the input type.
Source§

impl From<SendError<()>> for Error

Source§

fn from(source: SendError<()>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Error

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<StripPrefixError> for Error

Source§

fn from(source: StripPrefixError) -> Self

Converts to this type from the input type.
Source§

impl From<TotpUrlError> for Error

Source§

fn from(source: TotpUrlError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for Error

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromSliceError> for Error

Source§

fn from(source: TryFromSliceError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<ZipError> for Error

Source§

fn from(source: ZipError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T