Files
nym/gateway/src/error.rs
T
Jon Häggblad 84c1679973 Add more nym- crate prefixes (#3284)
* Add nym- prefix to nymcoconut

* Add nym- prefix to validator-client

* Add nym- prefix to gateway-requests

* Add nym- prefix to mobile-storage

* Add nym- prefix to gateway-client

* Add nym- prefix to client-core

* rustfmt
2023-04-06 09:04:49 +02:00

48 lines
1.5 KiB
Rust

// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use nym_validator_client::nyxd::AccountId;
use nym_validator_client::ValidatorClientError;
use std::io;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub(crate) enum GatewayError {
#[error(
"failed to load config file for id {id} using path {path}. detailed message: {source}"
)]
ConfigLoadFailure {
id: String,
path: PathBuf,
#[source]
source: io::Error,
},
#[error("the configured version of the gateway ({config_version}) is incompatible with the binary version ({binary_version})")]
LocalVersionCheckFailure {
binary_version: String,
config_version: String,
},
#[error("another node on the network seems to have identical announce-host ({host})! Their identity is {remote_identity}, while ours is {local_identity}")]
DuplicateNodeHost {
host: String,
local_identity: String,
remote_identity: String,
},
#[error("could not obtain the information about current gateways on the network: {source}")]
NetworkGatewaysQueryFailure {
#[source]
source: ValidatorClientError,
},
#[error("address {account} has an invalid bech32 prefix. it uses '{actual_prefix}' while '{expected_prefix}' was expected")]
InvalidBech32AccountPrefix {
account: AccountId,
expected_prefix: String,
actual_prefix: String,
},
}