nym_cli_commands/context/
errors.rs

1// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: Apache-2.0
3
4use thiserror::Error;
5
6#[derive(Error, Debug)]
7pub enum ContextError {
8    #[error("mnemonic was not provided, pass as an argument or an env var called MNEMONIC")]
9    MnemonicNotProvided,
10
11    #[error("failed to parse mnemonic - {0}")]
12    Bip39Error(#[from] bip39::Error),
13
14    // there are lots of error that can occur in the nyxd client, so just pass through their display details
15    // TODO: improve this to return known errors
16    #[error("failed to create client - {0}")]
17    NyxdError(String),
18
19    #[error(transparent)]
20    NyxdErrorPassthrough(#[from] nym_validator_client::nyxd::error::NyxdError),
21
22    #[error(transparent)]
23    ValidatorClientError(#[from] nym_validator_client::ValidatorClientError),
24}