97b01db23e
* cleaned up MixProcessingError
* Added Error impl to (hopefully) all error enums in the codebase
* Replaced all occurences of error("{0}") with error(transparent)
* Changelog entry
26 lines
913 B
Rust
26 lines
913 B
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use nymsphinx_acknowledgements::surb_ack::SurbAckRecoveryError;
|
|
use nymsphinx_addressing::nodes::NymNodeRoutingAddressError;
|
|
use nymsphinx_types::Error as SphinxError;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum MixProcessingError {
|
|
#[error("failed to process received packet: {0}")]
|
|
SphinxProcessingError(#[from] SphinxError),
|
|
|
|
#[error("the forward hop address was malformed: {0}")]
|
|
InvalidForwardHopAddress(#[from] NymNodeRoutingAddressError),
|
|
|
|
#[error("the final hop did not contain a SURB-Ack")]
|
|
NoSurbAckInFinalHop,
|
|
|
|
#[error("failed to recover the expected SURB-Ack packet: {0}")]
|
|
MalformedSurbAck(#[from] SurbAckRecoveryError),
|
|
|
|
#[error("the received packet was set to use the very old and very much deprecated 'VPN' mode")]
|
|
ReceivedOldTypeVpnPacket,
|
|
}
|