Files
nym/wasm/client/src/error.rs
T
Jędrzej Stuczyński adb248dbcc chore: refresh wasm sdk (#5353)
* make packet statistics wasm-compatible

* fixed possible overflow issue in delay controller

* updated wasm-client to be compatible with the current network

* applied same logic to mixfetch client

* removed dead imports

* updated versions
2025-01-15 17:11:17 +00:00

54 lines
1.4 KiB
Rust

// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use thiserror::Error;
use wasm_client_core::error::WasmCoreError;
use wasm_client_core::topology::WasmTopologyError;
use wasm_client_core::ClientCoreError;
use wasm_utils::wasm_error;
#[cfg(feature = "node-tester")]
use nym_node_tester_utils::error::NetworkTestingError;
#[derive(Debug, Error)]
pub enum WasmClientError {
#[error(transparent)]
CoreError {
#[from]
source: WasmCoreError,
},
#[error("failed to parse mix config options: {source}")]
MalformedConfigOptions {
#[from]
source: serde_wasm_bindgen::Error,
},
#[error("provided topology was malformed: {source}")]
InvalidTopology {
#[from]
source: WasmTopologyError,
},
#[cfg(feature = "node-tester")]
#[error("failed to test the node: {source}")]
NodeTestingFailure {
#[from]
source: NetworkTestingError,
},
#[error("the node testing features are currently disabled")]
DisabledTester,
}
// I dislike this so much - there must be a better way.
impl From<ClientCoreError> for WasmClientError {
fn from(value: ClientCoreError) -> Self {
WasmClientError::CoreError {
source: WasmCoreError::BaseClientError { source: value },
}
}
}
wasm_error!(WasmClientError);