#[non_exhaustive]pub enum ProtocolError {
SerializationFailed(String),
DeserializationFailed(String),
MessageTooLarge {
size: usize,
max_size: usize,
},
ChunkTooLarge {
size: usize,
max_size: usize,
},
AddressMismatch {
expected: XorName,
actual: XorName,
},
StorageFailed(String),
PaymentFailed(String),
QuoteFailed(String),
Internal(String),
ClientUpdateRequired {
client_settlement_version: u32,
min_settlement_version: u32,
},
StorerUpdateRequired {
client_settlement_version: u32,
node_settlement_version: u32,
},
}Expand description
Errors that can occur during protocol operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SerializationFailed(String)
Message serialization failed.
DeserializationFailed(String)
Message deserialization failed.
MessageTooLarge
Wire message exceeds the maximum allowed size.
ChunkTooLarge
Chunk exceeds maximum size.
AddressMismatch
Content address mismatch (hash(content) != address).
StorageFailed(String)
Storage operation failed.
PaymentFailed(String)
Payment verification failed.
QuoteFailed(String)
Quote generation failed.
Internal(String)
Internal error.
ClientUpdateRequired
The client settles payments under rules this node no longer accepts, so no quote was issued.
Refused at quote time on purpose. A client that pays under superseded rules produces an on-chain payment every storer will reject, and that payment cannot be refunded, so the only useful place to stop it is before the client spends anything.
Appended last so existing variants keep their wire discriminants. A peer old enough not to know this variant cannot be sent it: it would have had to send a V2 request to earn it, and only builds that carry this variant do that.
Fields
StorerUpdateRequired
This node settles under older rules than the client, so it declined to quote rather than promise to accept a payment it may not recognise.
The mirror image of Self::ClientUpdateRequired, and deliberately a
separate variant: it is not a verdict about the client, and a client
that receives it should quietly use a different storer rather than tell
its user anything. During a client-first rollout most of the fleet is
briefly in this state, so treating it as a client fault would strand
every up-to-date user.
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl<'de> Deserialize<'de> for ProtocolError
impl<'de> Deserialize<'de> for ProtocolError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ProtocolError
impl Display for ProtocolError
impl Eq for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
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()
Source§impl PartialEq for ProtocolError
impl PartialEq for ProtocolError
Source§impl Serialize for ProtocolError
impl Serialize for ProtocolError
impl StructuralPartialEq for ProtocolError
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
impl UnwindSafe for ProtocolError
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<'de, T> BorrowedRpcObject<'de> for 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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