#[non_exhaustive]pub enum Error {
Show 68 variants
InvalidKeyLength {
expected: usize,
actual: usize,
},
InvalidDataLength {
expected: usize,
actual: usize,
},
InvalidHex(String),
InvalidBase58(String),
InvalidBase64(String),
CryptoError(String),
InvalidSignature(String),
InvalidPublicKey(String),
InvalidPrivateKey(String),
PointAtInfinity,
DecryptionFailed,
InvalidNonce(String),
InvalidTag,
InvalidUtf8(String),
ReaderUnderflow {
needed: usize,
available: usize,
},
NonCanonicalVarInt {
width: u8,
value: u64,
},
CompactSizeTooLarge(u64),
InvalidChecksum,
ScriptParseError(String),
ScriptExecutionError(String),
InvalidOpcode(u8),
DisabledOpcode(u8),
StackUnderflow,
StackOverflow,
Bip276Error(String),
InvalidAddress(String),
InvalidAddressLength(String),
UnsupportedAddress(String),
TransactionError(String),
MerklePathError(String),
BeefError(String),
FeeModelError(String),
WalletError(String),
WalletBusy {
detail: String,
retry_after_ms: Option<u64>,
},
WalletTransport {
status: Option<u16>,
detail: String,
},
KeyDerivationError(String),
ProtocolValidationError(String),
InvalidCounterparty(String),
MessageVersionMismatch {
expected: String,
actual: String,
},
MessageError(String),
MessageRecipientMismatch {
expected: String,
actual: String,
},
InvalidMnemonic(String),
InvalidEntropyLength {
expected: String,
actual: usize,
},
InvalidMnemonicWord(String),
InvalidExtendedKey(String),
HardenedFromPublic,
InvalidDerivationPath(String),
EciesDecryptionFailed(String),
EciesHmacMismatch,
AuthError(String),
SessionNotFound(String),
CertificateValidationError(String),
TransportError(String),
OverlayError(String),
NoHostsFound(String),
OverlayBroadcastFailed(String),
RegistryError(String),
DefinitionNotFound(String),
InvalidDefinitionData(String),
KvStoreError(String),
KvStoreKeyNotFound(String),
KvStoreCorruptedState(String),
KvStoreEmptyContext,
KvStoreInvalidKey,
KvStoreInvalidValue,
IdentityError(String),
IdentityNotFound(String),
ContactNotFound(String),
}Expand description
Main error type for the BSV SDK.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidKeyLength
Invalid key length for cryptographic operations.
Fields
InvalidDataLength
Invalid data length for cryptographic operations.
Fields
InvalidHex(String)
Invalid hex string.
InvalidBase58(String)
Invalid base58 string.
InvalidBase64(String)
Invalid base64 string.
CryptoError(String)
Cryptographic operation failed.
InvalidSignature(String)
Invalid signature.
InvalidPublicKey(String)
Invalid public key.
InvalidPrivateKey(String)
Invalid private key.
PointAtInfinity
Point at infinity (invalid for most operations).
DecryptionFailed
Decryption failed.
InvalidNonce(String)
Invalid nonce.
InvalidTag
Invalid tag (for authenticated encryption).
InvalidUtf8(String)
Invalid UTF-8 sequence.
ReaderUnderflow
Reader underflow (not enough bytes to read).
NonCanonicalVarInt
A varint using more bytes than its value requires. Width includes the marker.
Fields
CompactSizeTooLarge(u64)
A node CompactSize above MAX_COMPACT_SIZE.
InvalidChecksum
Invalid checksum.
ScriptParseError(String)
Script parse error.
ScriptExecutionError(String)
Script execution error.
InvalidOpcode(u8)
Invalid opcode.
DisabledOpcode(u8)
Disabled opcode.
StackUnderflow
Stack underflow.
StackOverflow
Stack overflow.
Bip276Error(String)
BIP-276 encoding/decoding error.
InvalidAddress(String)
Invalid address.
InvalidAddressLength(String)
Invalid address length.
UnsupportedAddress(String)
Unsupported address type.
TransactionError(String)
Transaction error.
MerklePathError(String)
MerklePath error.
BeefError(String)
BEEF format error.
FeeModelError(String)
Fee model error.
WalletError(String)
General wallet error.
WalletBusy
The wallet is busy: a refusal before acting, in the wallet’s word.
The wallet answered that it refused the call before acting (a
contended store, a lock not acquired) and promised that nothing was
written, built or locked, so the caller may repeat the same call
unchanged after retry_after_ms, or after a moment when it is None.
The SDK reports the server’s promise; it cannot check it.
HttpWalletJson reads it from the body’s code (STORE_BUSY,
ERR_SERVER_BUSY), never from the HTTP status; a 503 without that
code is Error::WalletTransport.
Fields
WalletTransport
The way to the wallet failed: no answer in the wallet’s word.
A caller may retry it; it carries no promise about what the wallet
did (the request may or may not have reached it), which is the one
way it differs from Error::WalletBusy. HttpWalletJson answers it
for a 502, 503 or 504 whose body carries no busy code and no numeric
wallet code, a connection error (refused, reset, DNS) and a timeout;
every other failure, and every refusal, stays Error::WalletError.
The crate never retries by itself.
Fields
KeyDerivationError(String)
Key derivation error.
ProtocolValidationError(String)
Protocol validation error.
InvalidCounterparty(String)
Invalid counterparty.
MessageVersionMismatch
Message version mismatch.
Fields
MessageError(String)
General message error.
MessageRecipientMismatch
Message recipient mismatch.
Fields
InvalidMnemonic(String)
Invalid mnemonic phrase.
InvalidEntropyLength
Invalid entropy length for mnemonic generation.
Fields
InvalidMnemonicWord(String)
Invalid word in mnemonic phrase.
InvalidExtendedKey(String)
Invalid extended key.
HardenedFromPublic
Cannot derive hardened child from public key.
InvalidDerivationPath(String)
Invalid derivation path.
EciesDecryptionFailed(String)
ECIES decryption failed.
EciesHmacMismatch
ECIES HMAC verification failed.
AuthError(String)
General authentication error.
SessionNotFound(String)
Session not found.
CertificateValidationError(String)
Certificate validation failed.
TransportError(String)
Transport error.
OverlayError(String)
General overlay error.
NoHostsFound(String)
No hosts found for service.
OverlayBroadcastFailed(String)
Broadcast to overlay failed.
RegistryError(String)
General registry error.
DefinitionNotFound(String)
Definition not found in registry.
InvalidDefinitionData(String)
Invalid definition data.
KvStoreError(String)
General kvstore error.
KvStoreKeyNotFound(String)
Key not found in kvstore.
KvStoreCorruptedState(String)
Corrupted kvstore state.
KvStoreEmptyContext
Empty context (protocol_id) provided to kvstore.
KvStoreInvalidKey
Invalid key provided to kvstore (empty).
KvStoreInvalidValue
Invalid value provided to kvstore (empty).
IdentityError(String)
General identity error.
IdentityNotFound(String)
Identity not found.
ContactNotFound(String)
Contact not found.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.