// Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 use nym_sphinx_acknowledgements::surb_ack::SurbAckRecoveryError; use nym_sphinx_addressing::nodes::NymNodeRoutingAddressError; use nym_sphinx_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, }