51779c06a4
* removing wg-gateway-client * bandwidth_provider trait * authenticator client * adapt ip-packet-client * nit * registration_client * accomodate new shutdown and bugfix * sdk changes * cleanup and shutdown management * remove credential mode * error cleanup * better error handling * removing useless cover traffic delay * wasm client stuff * cfg unix * more wasm stuff * change authenticator client to not be blocked by mixnet client
40 lines
1016 B
Rust
40 lines
1016 B
Rust
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
#[error("the provided base64-encoded client MAC ('{mac}') was malformed: {source}")]
|
|
MalformedClientMac {
|
|
mac: String,
|
|
#[source]
|
|
source: base64::DecodeError,
|
|
},
|
|
|
|
#[cfg(feature = "verify")]
|
|
#[error("failed to verify mac provided by '{client}': {source}")]
|
|
FailedClientMacVerification {
|
|
client: String,
|
|
#[source]
|
|
source: hmac::digest::MacError,
|
|
},
|
|
|
|
#[error("conversion: {0}")]
|
|
Conversion(String),
|
|
|
|
// TODO add version number for debugging
|
|
#[error("unknown version number")]
|
|
UnknownVersion,
|
|
|
|
// TODO add version number for debugging
|
|
#[error("unsupported request version")]
|
|
UnsupportedVersion,
|
|
|
|
#[error("gateway doesn't support this type of message")]
|
|
UnsupportedMessage,
|
|
|
|
#[error(transparent)]
|
|
Bincode(#[from] bincode::Error),
|
|
}
|